View Single Post
  #1  
Old February 18th 09, 04:02 PM posted to microsoft.public.outlook.program_vba
Jeremy
external usenet poster
 
Posts: 28
Default Cycle through all folders under Mailbox

Hi,

I would like to cycle through every folder in my mailbox and I have the
following code. However, i don't think this code will cycle through all
folders, I think it just cycles through those under my inbox. I don't think
the macro will cycle through folders located under .pst archives, or other
mailboxes that I have access to under my mailbox.

Is there a way a cycling through all folders, including those under other
mailboxes and archives?

My current macro is as follows:

Sub ProcessAllFolders()
ProcessSubFolder Application.ActiveExplorer.CurrentFolder
MsgBox "All Done!", vbInformation + vbOKOnly, "Process All Folders Macro"
End Sub

Sub ProcessSubFolder(olkFolder As Outlook.MAPIFolder)
Dim olkSubFolder As Outlook.MAPIFolder

'insert some code here to do something

For Each olkSubFolder In olkFolder.Folders
ProcessSubFolder olkSubFolder
Next
Set olkSubFolder = Nothing
End Sub

Ads