Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Portland, Maine, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Other Users Folder (Outlook 2002)

    I need to update another user's contacts, from an Access database. I know how to get to my folders and public folders, but what is the code to access another user's folders. I have rights to the folder and have it open in my folder list. Can I get to this?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Access Other Users Folder (Outlook 2002)

    Try iterating over the MAPIFolder objects at the top level of the Outlook NameSpace. I would think one of them is the container for the other person's contacts, but since I've never shared contacts, it's just a guess. (If you search the Lounge for MAPIFolder, you can find possibly helpful code snippets.)

  3. #3
    New Lounger
    Join Date
    Sep 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Other Users Folder (Outlook 2002)

    You can open the user's top level folder with:
    NS.Folders.Item("Mailbox - User Name")
    where NS is Outlook's MAPI namespace. The folder must already be open in your Outlook folder list.

    Let me know if you need the code or if you want to get to the folder without it being open in your Outlook folder list.

  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Eugene, Oregon, USA
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Other Users Folder (Outlook 2002)

    If you want to do this for folders that aren't attached to your Outlook folder list, try using the CreateRecipient and the GetSharedDefaultFolder methods of the Namespace object.

    (With thanks to Rory who gave me this hint a few months ago!).

  5. #5
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Portland, Maine, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Other Users Folder (Outlook 2002)

    Thank you for the input! This code if the folder is already open.

    Const FOLDER_TO_OPEN = "Mailbox - Username"
    ' Objects of initializing Outlook objects
    Dim objApp As Application
    Dim objNS As NameSpace
    Dim objFolder As MAPIFolder
    Dim itm 'As ContactItem
    Dim strFolder As String ' Name of the folder

    strFolder = "Contacts"

    'Initialize Outlook
    Set objApp = CreateObject("Outlook.Application")
    Set objNS = objApp.GetNamespace("MAPI")
    Set objFolder = objNS.Folders(FOLDER_TO_OPEN).Folders(strFolder)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •