Hi,
I have a macro that creates and sends out Outlook invites, but I’m having trouble getting it to send as a recurring meeting. For example, I’d like for it to occur daily (weekdays) between a start and end date (that data is in the spreadsheet). Is anyone able to assist?
Aaaaaaand the code would probably help…
Sub Meeting_Reporting()
Dim OutApp As Outlook.Application
Dim Outmeet As Outlook.AppointmentItem
Dim I As Long
Dim setupsht As Worksheet
Dim myNamespace As Outlook.Namespace
Dim myRecepient As Outlook.Recipient
Dim objfolder As Outlook.Folder
Dim RecurrPat As Outlook.RecurrencePattern
Set setupsht = Worksheets("Reporting")
For I = 2 To Range("A" & Rows.Count).End(xlUp).Row
Set OutApp = Outlook.Application
Set Outmeet = OutApp.CreateItem(olAppointmentItem)
Set myNamespace = OutApp.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("SendFromAddress")
Set RecurrPat = Outmeet.GetRecurrencePattern
myRecipient.Resolve
If myRecipient.Resolved Then
Set objfolder = myNamespace.GetSharedDefaultFolder(myRecipient, olFolderCalendar)
Else
ok = MsgBox("Unable to resolve the name of the sender.", vbCritical, "Error")
Exit Sub
End If
Set OutlookAppt = objfolder.Items.Add(olAppointmentItem)
With OutlookAppt
.Subject = setupsht.Range("J" & I).Value
.RequiredAttendees = emailaddress@test
.com
.OptionalAttendees = ""
.Start = setupsht.Range("H" & I).Value
.Duration = 0
.Location = "Desk"
.Body = ""
.AllDayEvent = False
.ReminderMinutesBeforeStart = setupsht.Range("G" & I).Value
.BusyStatus = Free
.ResponseRequested = False
.MeetingStatus = olMeeting
.Display
End With
'SendKeys "%s", True
Next I
Set RecurrPat = Nothing
Set OutItem = Nothing
Set OutApp = Nothing
End Sub