I'm having issues accessing emails in a specific folder within Outlook.
When I put the emails in the Inbox, the following line of code works.
Set OtlkApp = GetObject(, "Outlook.application")
Set ns = OtlkApp.GetNamespace("MAPI")
Set fldr = ns.GetDefaultFolder(olFolderInbox)
However, when I try to access a folder called "tempfiles", it could not find the object when I tried opening it using this code.
Set fldr = ns.Folders("tempfiles")
Is the syntax correct? Am I missing something?
Depending on the level of tempfolders (same level or subfolder of Inbox) you extend the folders property: