In a Word document a button fires a macro that creates an Outlook Meeting with the required recipients, subject line, and boilerplate body. The sender will then tweak and send.
The issue is, if I send a meeting invite and take leave from work, a co-worker cannot adjust the meeting times.
Rather than all of us sharing our calendars with full rights, I'd like to set up the meeting from a shared calendar we all have edit rights to.
The code that currently works (for my calendar):
Private Sub CommandButton900_Click()
Dim xOutlookObj As Object
Dim OMail As Object
Dim xEmail As Object
Dim xMeeting As Object
Dim xDoc As Object
Dim myRequiredAttendee As Outlook.Recipient
Dim myOptionalAttendee As Outlook.Recipient
Set xOutlookObj = CreateObject("Outlook.Application")
'I've added the following two lines from what I've found online, but I can't figure out how to reference
'objFolder when creating the Outlook meeting.
Set objNamespace = xOutlookObj.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(9).Folders("Analytics Shared")
Set xMeeting = xOutlookObj.CreateItem(olAppointmentItem)
Set myRequiredAttendee = xMeeting.Recipients.Add("sample.email@address")
myRequiredAttendee.Type = olRequired
With xMeeting
.MeetingStatus = olMeeting
.Display
.Subject = "Review TELCON, "
.Duration = 60
xEmail.BodyFormat = olFormatHTML
xEmail.HTMLBody = "Meeting Body"
xEmail.GetInspector().WordEditor.Range.FormattedText.Copy
xMeeting.GetInspector().WordEditor.Range.FormattedText.Paste
End With
Set xDoc = Nothing
Set xMeeting = Nothing
Set xOutlookObj = Nothing
Application.ScreenUpdating = True
End Sub