I am having trouble trying to select a subfolder in SharedMailbox.
I have read a number of resources on GetSharedDefaultFolder
.
However, struggling to put it together correctly.
Would be really great if you could help with this.
Sub ListOutlookEmailInfoInExcel()
Dim olNS As Outlook.NameSpace
Dim olTaskfolder As Outlook.MAPIFolder
Dim olTask As Outlook.TaskItem
Dim olItems As Outlook.Items
Set o1NS = GetNamespace("MAPI")
Set o1TaskFolder = o1NS.GetSharedDefaultFolder("Shared Folder 1", _
olFolderInbox).Folders("admin")
Set o1Items = o1TaskFolder.Items
End Sub
You first resolve the owner as described here http://www.slipstick.com/developer/working-vba-nondefault-outlook-folders/
"You can use the mailbox owner's display name, alias, or email address when resolving the recipient."
The GetSharedDefaultFolder method of the Namespace class accepts two parameters: a Recipient object and the FolderType value.
The How to: Display a Shared Calendar of a Recipient article provides the following sample code in C#: