Access Outlook default folder

前端 未结 1 709
春和景丽
春和景丽 2020-12-10 18:42

I working on an Outlook VBA application and I need to access my inbox but I seem to be having some trouble. I am using the GetDefaultFoldder(olFolderInbox) meth

相关标签:
1条回答
  • 2020-12-10 19:22

    You can use the Folders property, and string multiple Folders properties together, to get at any folder in the namespace. Some examples

    The Inbox (same as GetDefaultFolder(olInbox))

    ns.Folders("Personal Folders").Folders("Inbox")
    

    A subfolder of Inbox named Backup

    ns.Folders("Personal Folders").Folders("Inbox").Folders("Backup")
    

    The OtherInbox at the same level as Personal Folders

    ns.Folders("OtherInbox")
    

    The GetDefaultFolder is good for quickly getting to a default folder, but if you need something other than the default, just navigate down the tree with the Folders property of the NameSpace object.

    0 讨论(0)
提交回复
热议问题