Excel Create Outlook Appt in Excel VBA

Joined
Mar 23, 2011
Messages
1
Reaction score
0
Hello,

I would like to create an Outlook appointment in Excel VBA. I was trying to use late binding (because I'm not sure which version my users would have, and because early binding wasn't working for me). Here's what I have so far:

Code:
Sub appointment()
 
Dim OutlookApp
Dim AP
Set OutlookApp = GetObject(, "Outlook.Application")
OutlookApp.GetNamespace("MAPI").Logon
Set AP = OutlookApp.CreateItem(olAppointmentItem)
With AP
.Display (True)
End With
 
End Sub

The problem is that not matter what I put in the CreateItem parentheses, it always returns an email item (instead of an appointment). Any help would be very welcome! Thank you!
 
Back
Top