VBA to send out recurring Outlook Meeting

cdrobinson83

New Member
Joined
May 3, 2021
Messages
21
Office Version
  1. 365
Platform
  1. Windows
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?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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
 
Upvote 0
Sorted it out. More or less, needed to be With Outmeet as opposed to With OutlookAppt. Happy to share my code if anyone is interested.
 
Upvote 0

Forum statistics

Threads
1,215,294
Messages
6,124,101
Members
449,142
Latest member
championbowler

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top