Outlook voting buttons

I saw the thread on adding voting buttons with the Invoke Code activity. I followed the steps in that post and have the following code written. I am getting a lot of complier errors. Can someone please help me make this work?


here is the link to the post I am referring to. I followed the steps written here.


first of all we need to add the Microsoft.Office.Interop.Outlook depence:

next, in the invoke code activity change the language to C#:

next, change the New method to new method (lower case because we working on c#)


here is the code:

Microsoft.Office.Interop.Outlook.MailItem mailItem;

Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();

mailItem = (Microsoft.Office.Interop.Outlook.MailItem)outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);

mailItem.Subject = "This Is the subject";
mailItem.To = "mail to send";
mailItem.Body = "This Is the message";
mailItem.VotingOptions = "Test1;Test2";


hope it helps regards!

Will this work if outlook is not installed on the machine the bot is running from?

it will not work without the Outlook installed.