Sending Outlook Calendar Invite

Novice1

Registered User.
Local time
Yesterday, 16:30
Joined
Mar 9, 2004
Messages
385
I'm trying to send an Outlook Calendar Invite. The following VBA works but I cannot specify the recipient of the e-mail. I tried .to = "ABC" without success. Any ideas?


On Error GoTo StartError

Dim objOutlook As Outlook.Application
Dim objItem As Object

Set objOutlook = CreateObject("Outlook.Application")
Set objItem = objOutlook.CreateItem(olAppointmentItem)

With objItem

.Subject = "Final Out"
.Start = (Response_Due_Date) + TimeValue("9:00:00")
.ReminderMinutesBeforeStart = 1440

End With

objItem.Display
'Set objOutlook = Nothing


Exit Sub

StartError:
MsgBox "Error: " & Err & " " & Error
 
Found problem ... use

.RequiredAttendees = "afb@us.af.mil"
 
This code

Code:
Sub app()
Dim OutApp As Outlook.Application 
Dim OutMail As Outlook.AppointmentItem 

Set OutApp = New Outlook.Application
Set OutMail = OutApp.CreateItem(olAppointmentItem)

With OutMail
   .MeetingStatus = olMeeting
   .Location = " happening"
   .Subject = " Event check "
   .Start = "8:00 PM" & Format(Date)
   .End = "9:00 PM" & Format(Date)
   .Body = "this is event details"
   .Recipients.Add ("someone@gmail.com") ' This line is not working
  ' .Display
   .Send

End With
End Sub

From http://stackoverflow.com/questions/...ecipients-property-in-outlook-appointmentitem seems to work better than they say it does. Maybe this will help get you going
 
I spoke to soon. I want to send the Calendar Invite to an e-mail address in a field [SubjectEmail] o the form. If I manually type in an e-mail address, then the code works but if I refer to the field, then my e-mail address appears as the invitee. Not sure what's going on here.


On Error GoTo StartError

Dim objOutlook As Outlook.Application
Dim objItem As Object

Set objOutlook = CreateObject("Outlook.Application")
Set objItem = objOutlook.CreateItem(olAppointmentItem)

With objItem

.RequiredAttendees = "afb@us.af.mil"
.Subject = "Final Out"
.Start = (Response_Due_Date) + TimeValue("9:00:00")
.ReminderMinutesBeforeStart = 1440

End With

objItem.Display
'Set objOutlook = Nothing


Exit Sub

StartError:
MsgBox "Error: " & Err & " " & Error
 

Users who are viewing this thread

Back
Top Bottom