PDA

View Full Version : Solved: Create Weekly Meeting



GMan
04-18-2008, 11:21 AM
I have a meeting that will need to be scheduled in outlook every week. However the participants in the meeting change based on who is on-call. I have setup a spreadsheet the shows week by week who is on-call and a macro that will determine which week we are on and send an e-mail to those who should be attending. However, I don't want to send an e-mail I want to send a meeting request.

My limited experience is failing me in my attempt to change the mail to a meeting request. Below I have included the code that is currently creating the mail.

Set OutApp = CreateObject("Outlook.Application")
Set OutMeeting = OutApp.CreateItem(olMeetingItem)
With OutMeeting
.To = stSendTo
.CC = ""
.BCC = ""
.Subject = stSubject
.Body = stBody
.Display 'or use .Send
.NoAging = True
End With
OutMeeting.Close (olSave)
Application.ScreenUpdating = True
Set OutMeeting = Nothing
Set OutApp = Nothing


I am thinking that I just need some added Properties to the OutMeeting Object. But I can not seem to find what properties to add to make it a meeting request.

Thanks!

GMan
04-18-2008, 01:37 PM
Well, persistance pays off.... ALMOST. I have got the meeting request created and reoccurring. However, I seem to only be able to set the reoccurrance to Daily (including weekends). I really need it to be daily (excluding Saturday and Sunday) which there is a checkbox for this when creating the meeting reoccurrance manually. I would assume you can check this property with VBA but can find the property.

PLEASE HELP!!! :banghead:

Again, my code is below.

Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMeeting = OutApp.CreateItem(olAppointmentItem)
OutMeeting.GetRecurrencePattern
With OutMeeting
.RequiredAttendees = stSendTo
.Subject = stSubject
.Location = "Conference Room I"
.Start = #4/18/2008 9:00:00 AM# '<-- Needs Updated
.Duration = 15
.Body = stBody
.ReminderSet = True
.Display 'or use .Send
.NoAging = True
End With
Set RecurrPatt = OutMeeting.GetRecurrencePattern
RecurrPatt.RecurrenceType = olRecursDaily
RecurrPatt.PatternStartDate = Cells(iRow, cStart)
RecurrPatt.PatternEndDate = Cells(iRow, cEnd)

OutMeeting.Close (olSave)
Application.ScreenUpdating = True
Set OutMeeting = Nothing
Set OutApp = Nothing

JKwan
04-23-2008, 08:26 AM
maybe this will help:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr08/hey0422.mspx

GMan
09-08-2008, 12:38 PM
Thanks JKWan. This did get me the information I have been searching for! :beerchug: