I'm trying to create an Outlook meeting invite.
The meeting invite is created. Subject and other fields are also updated.
I get an empty body when I use .HTMLBody
.
Code I tried:
Set OutApp = Outlook.Application
Set OutMeet = OutApp.CreateItem(olAppointmentItem)
With OutMeet
.Subject = Subj
.RequiredAttendees = ActiveSheet.Range("G9").Value
ThisWorkbook.Sheets("Sheet1").Select
.Start = ThisWorkbook.Worksheets("Sheet1").Range("D2").Value
.Duration = 10
.Importance = olImportanceHigh
.ReminderMinutesBeforeStart = 15
ThisWorkbook.Sheets("Sheet2").Select
.BodyFormat = olFormatHTML
.HTMLBody = "<html><head></head><body>Hi</body></html>"
Application.Visible = True
MeetingStatus = olMeeting
.Location = "Microsoft Teams"
.Display
End With
Set OutMeet = Nothing
Set OutApp = Nothing
End Sub