rrdcomclient

RDCOMClient and Outlook: Booking a meeting


I am trying to book a recurring meeting in Outlook via a script in R which I will batch to run every week. We are not allowed to book recurring meetings at the moment since rooms are at a premium. I have used RDCOMClient to send automated emails so I am thinking there might be a way to do it with that package. I've looked through Stack Overflow and documentation and haven't found anything specific for this yet. I am thinking it would look something like this:

OutApp <- COMCreate("Outlook.Application")

outMeeting = OutApp$CreateItem(0)

outMeeting[["To"]] = paste("Person1@company.com","Person2@Company.com","Room1@Company.com", sep = ";", collapse = NULL)
outMeeting[["start"]] = strptime(2017/04/28 13:30, "%Y/%m/%d %H:%M")
outMeeting[["end"]] = strptime(2017/04/28 14:30, "%Y/%m/%d %H:%M")
outMeeting[["subject"]] = "Weekly Meeting"
outMeeting[["body"]] = "Hi Team,

Attached is the weekly meeting agenda.

Thanks,
Person 3"

outMeeting$Send() 

Any thoughts on if and how this could work?


Solution

  • I know this is pretty old, but I've been trying to do the same thing, and I figured it out. You'll want to do the following:

    OutApp <- COMCreate$("Outlook.Application")
    OutMeeting <- OutApp$CreateItem(1)
    
    OutMeeting[["Start"]] = "2019-02-22 08:00"
    OutMeeting[["Subject"]] = "Weekly Meeting"
    OutMeeting[["Body"]] = "Hi Team,
    
    Attached is the weekly meeting agenda.
    
    Thanks,
    Person 3"
    OutMeeting[["Duration"]] = "60"
    # MeetingStatus is key to this - that's how it can be sent to others as an invite
    OutMeeting[["MeetingStatus"]] = "1"
    OutMeeting[["Recipients"]]$Add("Person1@company.com")
    OutMeeting[["Recipients"]]$Add("Person2@Company.com")
    OutMeeting[["Recipients"]]$Add("Room1@Company.com")
    OutMeeting$Save()
    OutMeeting$Send()
    

    That ought to get you there.