View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MSweetG222 MSweetG222 is offline
external usenet poster
 
Posts: 158
Default Outlook & SubFolders coding

I am coding to retrieve emails from Outlook (date, subject, body, sender,
etc.) and store the info in excel for later processing.

My code works fine until I want to process an Outlook folder that is not on
the same level as the 2 levels I have coded below.
Set myFolderToProcess = olMAPI.Folders("MyName").Folders("Inbox").


I can modify the code to read:
Set myFolderToProcess =
olMAPI.Folders("MyName").Folders("Inbox").Folders( "Sales")
to add the 3rd level and it works - but this cannot be the correct way to do
it.

What is the proper way to code this when you have folders that may be 2, 3,
4 levels deep (and may vary of # of levels each time)?

Thank you,
MSweetG222