Hi,
I would be grateful for your help with the below bit of code. I am trying to set up Outlook appointment from Excel with: specified location, start and end time, reminder, and pre-defined lists of required and optional attendees. The code works in general, although I have issues fine-tuning it.
I cannot figure out how to set it up as an actual appointment - when I use anything else but olMeeting it stops working. Right now as meeting type list of attendees is hidden at first and you need to use 'Invite Attendees' in Outlook invite to unhide it and enable Send button, which is inconvenient for my purpose.
I am using O365, but the same is true for every version I tried this code on.
Here is my code. I am not providing actual values.
Dim Required_Attendees As String
Dim Optional_Attendees As String
Dim Meeting_StartDate As String
Dim Appointment_Body As String
Dim Meeting_Location As String
Dim Subject_Line As String
Dim OutApp As Object
Set OutApp = GetObject(, "Outlook.Application")
Dim OutItem As Object
Set OutItem = OutApp.CreateItem(1)
With OutItem
.RequiredAttendees = Required_Attendees
.optionalattendees = Optional_Attendees
.Start = Meeting_StartDate
.End = Meeting_EndDate
.Body = Appointment_Body
.Location = Meeting_Location
.AllDayEvent = False
.Subject = Subject_Line
.ReminderMinutesBeforeStart = 10
.ReminderSet = True
.MeetingStatus = olMeeting
.Display
End With
Set OutItem = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True
Thanks,
NaiA7521
I would be grateful for your help with the below bit of code. I am trying to set up Outlook appointment from Excel with: specified location, start and end time, reminder, and pre-defined lists of required and optional attendees. The code works in general, although I have issues fine-tuning it.
I cannot figure out how to set it up as an actual appointment - when I use anything else but olMeeting it stops working. Right now as meeting type list of attendees is hidden at first and you need to use 'Invite Attendees' in Outlook invite to unhide it and enable Send button, which is inconvenient for my purpose.
I am using O365, but the same is true for every version I tried this code on.
Here is my code. I am not providing actual values.
Dim Required_Attendees As String
Dim Optional_Attendees As String
Dim Meeting_StartDate As String
Dim Appointment_Body As String
Dim Meeting_Location As String
Dim Subject_Line As String
Dim OutApp As Object
Set OutApp = GetObject(, "Outlook.Application")
Dim OutItem As Object
Set OutItem = OutApp.CreateItem(1)
With OutItem
.RequiredAttendees = Required_Attendees
.optionalattendees = Optional_Attendees
.Start = Meeting_StartDate
.End = Meeting_EndDate
.Body = Appointment_Body
.Location = Meeting_Location
.AllDayEvent = False
.Subject = Subject_Line
.ReminderMinutesBeforeStart = 10
.ReminderSet = True
.MeetingStatus = olMeeting
.Display
End With
Set OutItem = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True
Thanks,
NaiA7521