Add an event / meeting in Outlook via Excel ?

M

Mark Rosenkrantz

Dear all;

I want to add an event in Outlook by clicking a commandbutton on a UserForm.
I don't know if this is possible, but as many thnings can be done by VBA I
thought that one of you goeroes
might have a solution to this.

Can this be done ?

Mark.
 
B

Bob Phillips

Mark,

Here is a simple example

Sub CreateOutlookAppointment()
Dim oItem As Object
Dim oOLApp As Object
Set oOLApp = CreateObject("Outlook.Application")
Set oItem = oOLApp.CreateItem(1) 'olAppointmentItem
With oItem
.Subject = "Test value"
.Location = "My house"
.Start = #7/27/2004 10:00:00 AM#
.Duration = 30 ' minutes
.Body = "The agenda is as follows"
.Save
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top