I am trying to extract some detail from outlook mail such as “Flag Status”, “Flag Completed Date”, “Size”.etc put it into an excel sheet which has columns as “Sender”, “Subject”, “Received date”, “Categories”, “Size”(mail size) & “Flag Completed Date” . However am able to extract first there details from mail. But I m struggling to get “Size” and “Flag Completed Date”. Can anyone please help me to get the last two details from the mail?
Thanks & Regards,
This works in VBA but not in UiPath as far as I know. It seems that the mailitem object does not have this fields
Can you show how to do that?
Sure. You first have to decide how to run your VBA code to access Outlook mails. When using “get Outlook mails”, UiPath will create a mail-instance by copy the mails to a .netMail.Mailmessage. This variable will not be linked (By reference) to the mailmessage in Outlook. If you want to process the mail in Uipath with other activities after geting the Informations, then you will need the MailMessage variable anyway. In this case I would recommend to have a for each mail in Uipath and a VBA script that gets the data of the specific mail in the loop. A good way to tell the script which mail to load would be the Content-ID which is unique. Read here how to
Another approach would be that the VBA code has its own loop through the mails and drops the needed information somehow (write to CSV?).
As you can see here , the Outlook mail object has the properties you looking for.
To run the VBA code you can use “invoke code”. Inside the invoke code you can use the Outlook-objects similar to VBS. A very “RPA way” to solve the problem could be a Excel file which has a Makro and writes the mail properties to a sheet. The simply use invoke Makro. There are many templates for Excel Makros on the web which simply write mail data to a sheet.