Hi all
I try to access a subfolder within a shared mailbox in Outlook. The connection to the message storage form this shared mailbox works fine. But I struggle with accessing a subfolder within this shared mailbox. Here the code I use (extracted from Mapiex VBO):
Dim SharedMailboxName As String = "\\examplemailbox"
Dim SubFolder As String = "testfolder"
'Initialise the extended MAPI interface
Using mapi As New NetMAPI()
'log into mapi
mapi.Login(Profile)
'Connect to Shared Mailbox
If Not mapi.OpenMessageStore(SharedMailboxName) Then Throw New MAPIException("Failed to access message store")
'Access the subfolder
If Not mapi.Opensubfolder(SubFolder) Then Throw New MAPIException("Failed to access the subfolder")
When I run this I always get the error "Failed to access the subfolder". What I am doing wrong? Should I set subfolder with something like "\\examplemailbox\subfolder" or something like this? I tried already different constellations.
I really hope somebody can help me in this case.
Many thanks in advance
Kind Regards,
René