Reference Exchange Public Folder in vb.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Thunell

    #1

    Reference Exchange Public Folder in vb.net

    I have some vb.net code that goes and gets some information from our
    Contacts Public folder named "Pierce Contacts". As you see from the code
    below, i reference this folder by first navigating to the folder in outlook.
    Is there any way to reference the public folder programatically .
    The exchange public folder is under
    "Public Folders"
    "All Public Folders"
    "Pierce Contacts"

    Sample code:
    ol = New outlook.Applica tion
    olns = ol.getnamespace ("MAPI")
    ***-> olFolder = ol.activeexplor er.currentfolde r <-****** 'currentfolder'
    CurFolder = olFolder.name
    AllItems = olFolder.items
    NumItems = AllItems.count


    For Each Itm In AllItems
    'do some stuff here
    Next


  • Sue Mosher [MVP-Outlook]

    #2
    Re: Reference Exchange Public Folder in vb.net

    To get a non-default folder, you need to walk the folder hierarchy using the Folders collections, starting with Namespace.Folde rs, or use a function that does that for you. See http://www.outlookcode.com/d/code/getfolder.htm for a VB example that should give you the basic idea.

    --
    Sue Mosher, Outlook MVP
    Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    Create personalized and dynamic email templates in Outlook for Windows, Mac, and web and share them across devices and teams.



    "Chris Thunell" <cthunell@pierc eassociates.com > wrote in message news:%23ZQJrGFj FHA.3436@tk2msf tngp13.phx.gbl. ..[color=blue]
    >I have some vb.net code that goes and gets some information from our
    > Contacts Public folder named "Pierce Contacts". As you see from the code
    > below, i reference this folder by first navigating to the folder in outlook.
    > Is there any way to reference the public folder programatically .
    > The exchange public folder is under
    > "Public Folders"
    > "All Public Folders"
    > "Pierce Contacts"
    >
    > Sample code:
    > ol = New outlook.Applica tion
    > olns = ol.getnamespace ("MAPI")
    > ***-> olFolder = ol.activeexplor er.currentfolde r <-****** 'currentfolder'
    > CurFolder = olFolder.name
    > AllItems = olFolder.items
    > NumItems = AllItems.count
    >
    >
    > For Each Itm In AllItems
    > 'do some stuff here
    > Next
    >
    >[/color]

    Comment

    Working...