AppointmentItem Methods

Following are most or all of the methods for the AppointmentItem Object (appointments, meetings). Each method is encapsulated in its own function.

I prefer this method rather than calling each method inline.

I did not include sample code for each function. See TaskItem Methods for sample code you can adapt. Simply call each function and pass in an AppointmentItem. This will allow you to, for example, iterate through an appointments folder in a For Each loop and call the function on each appointment or meeting.

ClearRecurrencePattern Method

Function ApptClearRecurrencePattern(appt As Outlook.AppointmentItem)
  appt.ClearRecurrencePattern
End Function

Close Method

Function CloseAppointment(appt As Outlook.AppointmentItem, saveAppt As _
                                                           Outlook.OlInspectorClose)
  appt.Close saveAppt
End Function

Copy Method

Function CopyAppointment(appt As Outlook.AppointmentItem) As Outlook.AppointmentItem
  Set CopyAppointment = appt.Copy
End Function

Delete Method

Function DeleteAppointment(appt As Outlook.AppointmentItem)
  appt.Delete
End Function

Display Method

Set displayMode to True to make the AppointmentItem display box modal.

Function DisplayAppointment(appt As Outlook.AppointmentItem, Optional displayMode As Boolean = False)
  appt.Display displayMode
End Function

ForwardAsVcal Method

Function CreateVCal(appt As Outlook.AppointmentItem) As Outlook.MailItem
  Set CreateVCal = appt.ForwardAsVcal
End Function

GetRecurrencePattern Method

Function GetRecurrences(appt As Outlook.AppointmentItem) As _
         Outlook.RecurrencePattern
  Set GetRecurrences = appt.GetRecurrencePattern
End Function

Move Method

The Move Method requires a MAPIFolder object, which you pass to the function. How you choose to create that is up to you.

Function MoveAppointment(appt As Outlook.AppointmentItem, _
                         fldr As Outlook.MAPIFolder) As Outlook.AppointmentItem
  Set MoveAppointment = appt.Move(fldr)
End Function

PrintOut Method

Function PrintAppointment(appt As Outlook.AppointmentItem)
  appt.PrintOut
End Function

Respond Method

Function RespondToAppointment(appt As Outlook.AppointmentItem, Response As OlMeetingResponse, _
                              Optional showDialog As Boolean = True, Optional addlPrompt As Boolean = True)
' http://msdn.microsoft.com/en-us/library/aa210273(office.11).aspx
'OlMeetingResponse can be one of these OlMeetingResponse constants.
'For an AppointmentItem object:
'olMeetingAccepted
'olMeetingDeclined
'olMeetingTentative

  appt.Respond Response, showDialog, addlPrompt
  ' see below for SendAppointment function
  Call SendAppointment(appt)
End Function

Save Method

Function SaveAppointment(appt As Outlook.AppointmentItem)
  appt.Save
End Function

SaveAs Method

Function SaveAppointmentAs(appt As Outlook.AppointmentItem, filePath As String, _
                           Optional fileType As OlSaveAsType = olTXT)
  If Len(Dir(filePath, vbDirectory)) > 0 Then
    appt.SaveAs filePath, fileType
  End If
End Function

Send Method

Function SendAppointment(appt As Outlook.AppointmentItem)
  appt.Send
End Function

ShowCategoriesDialog Method

Function AppointmentCategoriesDialog(appt As Outlook.AppointmentItem)
  appt.ShowCategoriesDialog
End Function

Site last updated: May 17, 2012

Random Data Generator