[dba-Tech] Exporting Outlook items to Excel

Susan Harkins ssharkins at gmail.com
Wed Oct 1 08:55:05 CDT 2008


I'm exporting some mail items from Outlook to an Excel workbook. The code works fine, but I'm wondering if it's the most efficient? Basically, I'm using simple counter statements (i = i + 1) to update the row and column elements as the code inserts each item. 

I don't know of any other way to do this, so just curious -- it is working, so I don't need a solution unless there's a more dynamic way to do it. 

 For Each itm In fld.Items
         
         ...

         Set rng = wks.Cells(i, j)
         rng.Value = msg.To
         j = j + 1

        ....

After inserting each field, I update the counter. I also update the row at the end of this For. 

Susan H. 


More information about the dba-Tech mailing list