Imports System.Reflection
Module Module1
Sub Main()
' Create an Outlook application.
Dim oApp As Outlook.Application = New Outlook.Application()
' Get Mapi NameSpace and Logon.
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
oNS.Logon("YourValidProfile", Missing.Value, False, True) ' TODO:
' Create an AppointmentItem.
Dim oAppt As Outlook._AppointmentItem = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
'oAppt.Display(true) 'Modal
' Change AppointmentItem to a Meeting.
oAppt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting
' Set some common properties.
oAppt.Subject = "Created using OOM in VB.NET"
oAppt.Body = "Hello World"
oAppt.Location = "Samm E"
oAppt.Start = Convert.ToDateTime("11/30/2001 9:00:00 AM")
oAppt.End = Convert.ToDateTime("11/30/2001 1:00:00 PM")
oAppt.ReminderSet = True
oAppt.ReminderMinutesBeforeStart = 5
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy ' olBusy
oAppt.IsOnlineMeeting = False
oAppt.AllDayEvent = False
' Add attendees.
Dim oRecipts As Outlook.Recipients = oAppt.Recipients
' Add required attendee.
Dim oRecipt As Outlook.Recipient
oRecipt = oRecipts.Add("UserTest1") ' TODO:
oRecipt.Type = Outlook.OlMeetingRecipientType.olRequired
' Add optional attendee.
oRecipt = oRecipts.Add("UserTest2") ' TODO:
oRecipt.Type = Outlook.OlMeetingRecipientType.olOptional
oRecipts.ResolveAll()
'oAppt.Display(true)
' Send out request.
oAppt.Send()
' Logoff.
oNS.Logoff()
End Sub
End Module