Finance

Charts

Statistics

Macros

Search

Creating an Appointment in Outlook with Excel VBA

Items in the Calendar folder are objects of the type AppointmentItem. These objects have different properties compared to MailItem objects. The following example shows how to add a new appointment to the personal calendar using VBA:

Sub CreateAppointment()
    Dim appOutlook As Outlook.Application
    Dim appointment As Outlook.AppointmentItem
    ' Start Outlook application
    Set appOutlook = CreateObject("Outlook.Application")
    ' Create a new appointment item
    Set appointment = appOutlook.CreateItem(olAppointmentItem)
    ' Assign properties to the appointment
    appointment.Start = "10/06/2025 09:45"
    appointment.Duration = 60        ' Duration in minutes
    appointment.Subject = "Test"
    appointment.Location = "here"
    ' Save the appointment
    appointment.Save
    ' Quit Outlook and clean up
    appOutlook.Quit
    Set appointment = Nothing
    Set appOutlook = Nothing
End Sub

Explanation:
Using the method CreateItem() along with the constant olAppointmentItem, a new Outlook item of the type AppointmentItem is created.

Several key properties of the appointment are then set:

  • Start: Defines the start date and time of the appointment (format: dd.mm.yyyy hh:mm).
  • Duration: Specifies the length of the appointment in minutes.
  • Subject: The subject or title of the appointment.
  • Location: The place where the appointment takes place.

The new appointment is saved in Outlook’s calendar with the Save() method.

0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx