Be_Dang3rous
03-16-2015, 06:40 AM
Good Morning,
I keep hitting road block after road block trying to modify my below code to create the meetings in a public folder calendar instead of my own calendar. I would be forever greatful if anyone could help me. Basically I have a userform that will have a StartDate and an EndDate field that sets recurring 30 minute meetings from 7 AM to 6 PM on a calendar and a recipients calendar (the reason for this need still has not been explained to me but I am just going with it). I am now trying to change the below working code to create the meeting in a public folder calendar automatically and not my own.
I have tried the GetFolder function but I cannot get it to work and keep receiving an Error message about missing variables.
Here is the code I am starting with
Set Start = ReservationAutomation.StartDateSet EndOn = ReservationAutomation.EndDate
Const olAppointmentItem = 1
Const olRecursDaily = 0
Dim myRequiredAttendee, myOptionalAttendee, myResourceAttendee As Outlook.Recipient
'7 AM
Set objOutlook = CreateObject("Outlook.Application")
Set ObjAppointment = objOutlook.CreateItem(olAppointmentItem)
ObjAppointment.MeetingStatus = olMeeting
ObjAppointment.Start = StartDate & " 7:00:00 AM"
ObjAppointment.Duration = 30
ObjAppointment.Recipients.Add("3035 -Lync")
ObjAppointment.Subject = "Blocked"
'objAppointment.Body = ""
'objAppointment.Location = "3035 -Lync"
Set objRecurrence = ObjAppointment.GetRecurrencePattern
objRecurrence.RecurrenceType = olRecursDaily
objRecurrence.PatternStartDate = StartDate
objRecurrence.PatternEndDate = EndDate
ObjAppointment.Save
Thank you once again
I keep hitting road block after road block trying to modify my below code to create the meetings in a public folder calendar instead of my own calendar. I would be forever greatful if anyone could help me. Basically I have a userform that will have a StartDate and an EndDate field that sets recurring 30 minute meetings from 7 AM to 6 PM on a calendar and a recipients calendar (the reason for this need still has not been explained to me but I am just going with it). I am now trying to change the below working code to create the meeting in a public folder calendar automatically and not my own.
I have tried the GetFolder function but I cannot get it to work and keep receiving an Error message about missing variables.
Here is the code I am starting with
Set Start = ReservationAutomation.StartDateSet EndOn = ReservationAutomation.EndDate
Const olAppointmentItem = 1
Const olRecursDaily = 0
Dim myRequiredAttendee, myOptionalAttendee, myResourceAttendee As Outlook.Recipient
'7 AM
Set objOutlook = CreateObject("Outlook.Application")
Set ObjAppointment = objOutlook.CreateItem(olAppointmentItem)
ObjAppointment.MeetingStatus = olMeeting
ObjAppointment.Start = StartDate & " 7:00:00 AM"
ObjAppointment.Duration = 30
ObjAppointment.Recipients.Add("3035 -Lync")
ObjAppointment.Subject = "Blocked"
'objAppointment.Body = ""
'objAppointment.Location = "3035 -Lync"
Set objRecurrence = ObjAppointment.GetRecurrencePattern
objRecurrence.RecurrenceType = olRecursDaily
objRecurrence.PatternStartDate = StartDate
objRecurrence.PatternEndDate = EndDate
ObjAppointment.Save
Thank you once again