
Exchange folder clashes with personal folder
I am trying to access shared calendars on an exchange server, but for one
folder the name on the exchange server is the same as the name in my local
address book and the personal address book entry is returned rather then the
exchange server folder. Is there any way that I can locate the exchange
server calendar?
The code I am currently using is as follows:
Set olApp = CreateObject("Outlook.Application")
If Not olApp Is Nothing Then
' link with outlook was successful
Set olNameSpace = olApp.GetNamespace("MAPI")
Set olRecipient = olNameSpace.CreateRecipient(calendarName)
If Not olRecipient.Resolved Then
' only resolve name if it has not been automatically resolved
olRecipient.Resolve
End If
If olRecipient.Resolved Then
If olRecipient.AddressEntry.type = "EX" Then
Set olCalFolder = olNameSpace.GetSharedDefaultFolder( _
olRecipient, olFolderCalendar)
End If
End If
End If
If olCalFolder Is Nothing Then
MsgBox "Exchange calendar not found"
End If