Click here to Skip to main content
15,888,454 members

Comments by tembz (Top 2 by date)

tembz 6-Jun-11 7:25am View    
How then do I loop through the list of calendars?
tembz 6-Jun-11 6:06am View    
Thanks Kim. Below is sample code I found from the "help" in Outlook of how to create a Receipient. I ran this and it gives me an error that "A dialog box is open." Find the code attached:

Private Sub CommandButton1_Click()
On Error GoTo On_Error

Call ResolveName

Exiting:
Exit Sub
On_Error:
MsgBox "error=" & Err.Number & " " & Err.Description
Resume Exiting

End

End Sub

Sub ResolveName()
Dim myNamespace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim CalendarFolder As Outlook.Folder

Set myNamespace = Application.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("Thembani Nxumalo")
myRecipient.Resolve
If myRecipient.Resolved Then
Call ShowCalendar(myNamespace, myRecipient)
End If
End Sub

Sub ShowCalendar(myNamespace, myRecipient)
Dim CalendarFolder As Outlook.Folder
Set CalendarFolder = myNamespace.GetSharedDefaultFolder _
(myRecipient, olFolderCalendar)
CalendarFolder.Display
End Sub