excelvbaoutlookicalendar

Adding atendees to a .ics file that is sent as an attachment


I am trying to create a meeting invite (with attendees), and then attach that invite to another email I generate (for someone else to send that meeting invite). In my research, it appears I need to create the Meeting Invite, save it as a file, and then attach the file to the outgoing email.

These are my attempts so far:

After either approach below, I do:

olMeeting.SaveAs desiredFileName, olICal

I attach the file to the outgoing email and send it.

Upon opening the email, everything is there except for the Attendees.

Thanks in advance

Attempt #1 using a string for the attendees

With olMeeting
    .requiredAttendees = requiredAttendeesString
    .Recipients.ResolveAll
    .subject = subject
    .BodyFormat = olFormatHTML
    .body = body
    .Start = meetingStartTime
    .End = meetingEndtime
    .location = location
    .ReminderMinutesBeforeStart = 15
End With

Attmept #2 doing a .recipients.Add from a requiredAttendeesCollection

With olMeeting
    For Each currentAttendee In requiredAttendeesCollection
        .Recipients.Add CStr(currentAttendee)    
        .Recipients.item(.Recipients.Count).Type = olRequired
    Next
    .Recipients.ResolveAll
    .subject = subject
    .BodyFormat = olFormatHTML
    .body = body
    .Start = meetingStartTime
    .End = meetingEndtime
    .location = location
    .ReminderMinutesBeforeStart = 15
End With

Solution

  • Try to create a meeting invitation in Outlook and send it to a Gmail mailbox - you can then look at the raw MIME meeting invitation source in your Google mailbox. You can then create a similar ICS file explicitly in your code - it is just a text file.