in reply to MS Outlook GetSharedDefaultFolder

Hi, Mitch

when you say "inboxname" is that the Name_Of_The_Inbox or your username as recognised by Exchange. You will probably find that it is the later that resolves as a recipient even though the other call to ->resolve may not 'fail'.

Replies are listed 'Best First'.
Re: Re: MS Outlook GetSharedDefaultFolder
by Mitch (Sexton) on Sep 04, 2003 at 17:50 UTC
    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

      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