none
Find Rooms in Exchange 2007 Programmatically? RRS feed

  • Question

  • Is there any way to find rooms (with certain text in the name or satisfying any other criteria/property) programmatically in Exchange/Outlook 2007?

    Note: I am using VB as programming language


    http://learn2automate.wordpress.com

    Vijay Gupta


    • Edited by gupta vijay Tuesday, August 27, 2013 8:56 AM
    Tuesday, August 27, 2013 8:53 AM

Answers

  • Thanks Dimitri,

    I looked around and the issue is resolved by choosing appropriate Address List and then accessing all the Address Entries inside that Address List.

    I used the below code:

    Set objOL = CreateObject("Outlook.Application")
    Set objNS=objOL.GetNameSpace("MAPI")
    Set objAL=objNS.AddressLists("All Rooms")

    For i =1  To objAL.AddressEntries.count Step 1

    Next


    http://learn2automate.wordpress.com Vijay Gupta

    • Marked as answer by gupta vijay Thursday, September 12, 2013 8:54 AM
    Thursday, September 12, 2013 8:54 AM

All replies

  • Call Namespace.ResolveName specifying the room name (returns Recipient object).

    To check whether a particular address entry is a room, read the PR_DISPLAY_TYPE_EX property (DASL name http://schemas.microsoft.com/mapi/proptag/0x39050003) using AddressEntry.PropeetyAccessor.GetProperty. For rooms the property value will be DT_ROOM (7).


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, August 27, 2013 4:26 PM
  • Thanks Dimitri,

    Can you please let me know, how to access the Global Address List and then iterate through it to check for the above property to find for the Room?

    http://learn2automate.wordpress.com Vijay Gupta

    Tuesday, September 10, 2013 4:22 PM
  • Do not iterate through all items in a GAL. Use Namespace.ResolveName.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, September 10, 2013 4:26 PM
  • Dimitri,

    Actually, I don't have to check whether a particular entity is room or not.....what I need to do is:

    find all the rooms pertaining to a particular location from the Global Address List....please suggest how to proceed in order to achieve this?


    http://learn2automate.wordpress.com Vijay Gupta

    Wednesday, September 11, 2013 8:00 AM
  • Thanks Dimitri,

    I looked around and the issue is resolved by choosing appropriate Address List and then accessing all the Address Entries inside that Address List.

    I used the below code:

    Set objOL = CreateObject("Outlook.Application")
    Set objNS=objOL.GetNameSpace("MAPI")
    Set objAL=objNS.AddressLists("All Rooms")

    For i =1  To objAL.AddressEntries.count Step 1

    Next


    http://learn2automate.wordpress.com Vijay Gupta

    • Marked as answer by gupta vijay Thursday, September 12, 2013 8:54 AM
    Thursday, September 12, 2013 8:54 AM