问题
I'm writing some application where I need to get an all available rooms within my organization. (the same list we get while we opening "Add Rooms" dialog in outlook) I assume that while we doing it through outlook he works against some exchange server, the question is is there a way to use outlook as a"proxy" between me to the exchange server?
I have no knowledge with exchange, and a little knowledge with outlook's interop...
Thanks in advance for any help.
回答1:
I don't know if this will work for you, but looking at the "All Rooms" container with OutlookSpy, the PR_CONTAINER_FLAGS property contains an undocumented bit 0x200. I do not see the same bit set for any other containers. Does something like the following work for you?
PR_CONTAINER_FLAGS = "http://schemas.microsoft.com/mapi/proptag/0x36000003"
set rooms = Nothing
set lists = Application.Session.AddressLists
for each list in lists
containerFlags = list.PropertyAccessor.GetProperty(PR_CONTAINER_FLAGS)
if (containerFlags And &H0200) <> 0 Then
set rooms = list
Exit For
End If
next
if (rooms Is Nothing) Then
MsgBox "Room container not found"
Else
MsgBox "Room container was found, its name is " & rooms.Name
for each room in rooms.AddressEntries
Debug.Print room.Name & " - " & room.Address
next
End If
来源:https://stackoverflow.com/questions/14853531/get-list-of-all-rooms-in-outlook