Category Archives: VB 6

Create an appointment in outlook using vb 6

This article demonstrates how to create an appointment in outlook programmatically using visual basic 6.0 through Microsoft Outlook’s object-model.

This example requires a button control in Standard EXE project in visual basic 6.0, you need an early-bound reference to a Microsoft Outlook type library. Double-click the button, and then add the following code:

Dim oApp As Outlook.Application
Set oApp = CreateObject("Outlook.Application")
Dim oNs As Outlook.NameSpace
Set oNs = olApp.GetNamespace("MAPI")
Dim oAppt As Outlook.AppointmentItem
Set oAppt = oApp.CreateItem(olAppointmentItem)
 oAppt.Start = "12/2/2011 2:20:00 PM"
With oAppt
      .Duration = 60
      .Subject = "meeting with Client"
      .Body = "About Project..."
      .Location = "Our New York Office"
      .ReminderSet = True
End With
Set oNs = Nothing
Set oAppt = Nothing
Set oApp = Nothing