B
Bob Smith
I'm trying to loop through all folders in a mailbox with no luck. I'm using
GetLast which seems to get me to my mailbox (can I always assume this?). This
is what I have so far, any help would be appreciated.
Sub LoopFolders()
Dim myOlApp As Application
Dim myNameSpace As NameSpace
Dim myFolder As MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.Folders.GetLast
While Not myFolder Is Nothing
MsgBox myFolder
Set myFolder = myFolder.Folders.GetNext '<-GetPrevious does not seem to
work
Wend
End Sub
GetLast which seems to get me to my mailbox (can I always assume this?). This
is what I have so far, any help would be appreciated.
Sub LoopFolders()
Dim myOlApp As Application
Dim myNameSpace As NameSpace
Dim myFolder As MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.Folders.GetLast
While Not myFolder Is Nothing
MsgBox myFolder
Set myFolder = myFolder.Folders.GetNext '<-GetPrevious does not seem to
work
Wend
End Sub