Gave up trying to be elegant and went with the following code format - it worked
Set mySubFolder(1) = GetFolderPath("\\email account\inbox\subfolder1name")
Set mySubFolder(2) = GetFolderPath("\\email account\inbox\subfolder2name")
Z
Set mySubFolder(1) = GetFolderPath("\\prof.smith.pbsc@gmail.com\inbox\PHY2048") '.items
Set mySubFolder(2) = GetFolderPath("\\prof.smith.pbsc@gmail.com\inbox\PHY2049") '.items
Reset the code as follows:
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Dim items
Set items = GetFolderPath("\\myEmail@gmail.com\inbox").items
'==
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox) ' Inbox folder...
=============
I applied the suggested addition so that the code looks as follows
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Dim items
Set items = GetFolderPath("\\myEmail@gmail.com\inbox").items
'==
Set myFolder =...
Prior to Outlook 2013, I was able to access emails that were diverted to a sub folder of the InBox. Code was
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox) ' Inbox...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.