in reply to Re: MS Outlook GetSharedDefaultFolder
in thread MS Outlook GetSharedDefaultFolder

Hi,

I'm actually using the smtp email address associated with the name, because that seems to be the unique identifier it's using to resolve. When I use the actual mailbox name it doesn't resolve.

Mitch
  • Comment on Re: Re: MS Outlook GetSharedDefaultFolder

Replies are listed 'Best First'.
Re: MS Outlook GetSharedDefaultFolder
by Anonymous Monk on Sep 05, 2003 at 07:30 UTC

    Hi,

    To resolve _my_ mailbox I've always done the following: (this is VBScript so . should be -> etc)

    Const strValidUser = "andermc"; '<- My NT/Exchange username Set objOutlook = CreateObject("Outlook.Application") Set objNS = objOutlook.GetNamespace("MAPI") Set objRecipient = objNS.CreateRecipient(strValidUser) objRecipient.Resolve If (False = objRecipient.Resolved ) Then '<- not return value from abo +ve! 'need to exit nicely

    Now we're resolved we need to get a default folder or whatever.

    Set objInbox = objNS.GetDefaultFolder(olFolderInbox) Set objFolder = objInbox.Folders(a_Folder_UNDER_Inbox) ...

    If the folder you really want isn't in YOUR default mailbox then you should check if that mailbox has a 'NT alias' or 'function ID' associated with it (Properties box from the GAL). Use that alias as the recipient name to get the default folder (olFolderInbox = 6) for that mailbox (Exchange will resolve it if your NT account has sufficient permissions) then use:

    #Create a folder object from a subfolder of Inbox... Set objFolder = objInbox.Folders(strMySubFolder) #Or use the Parent property to move UP the hierarchy

    HTH (and sorry I didn't take the time to convert my old code to Perl!) - Mark

      Resolution to Problem: The problem was that the mailbox was hidden. Once it was unhidden the contents was able to be read. Thanks for everyone's help

      Mitch