Sub printFolderPath()
Const olPublicFoldersAllPublicFolders = 18
Dim olApp As Object
Dim startFolder As Object
Set olApp = CreateObject("outlook.application")
Set startFolder = olApp.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders)
recurse startFolder
End Sub
Sub recurse(top As Object)
Dim fldr As Object
Debug.Print top.Name
For Each fldr In top.Folders
recurse fldr
Next
End Sub
|