I could not able to set Importance flag while sending mail from outlook.
I passed in assign value as MailMsg.Priority = MailPriority.High. Mail received successfully, but importance flag missing.
Hi,
The response given by the UiPath team is that it is not currently possible to set the high importance flag in outlook. We used a workaround. Started the email subject with “URGENT”
If you are using Invoke code activity this can be done. Use the below code.
Dim OutlookApp As Microsoft.Office.Interop.Outlook._Application
OutlookApp = New Microsoft.Office.Interop.Outlook.ApplicationClass
Dim mail As Microsoft.Office.Interop.Outlook.MailItem = DirectCast(OutlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem), Microsoft.Office.Interop.Outlook.MailItem)
mail.Subject = “Test Email”
mail.Body = “Test Email”
mail.To = “emailID”
mail.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh
mail.send()
You’ll have to import outlook interop namespace as well.
Let me know if it works.
Hello, your solution looks cool, however, I cannot find post regarding how to import outlook interop namespace neither in Forum nor Documentation, Could you please provide a reference on how to do this? Thanks a lot in advance!!!
Thank you @midhunsug661 .
And yes, I can make the namespace named Microsoft.Office.Interop.Outlook shown in the Imports per the steps you provided. However, there are some errors stopped me from running the code…
The errors are still there after I restarted my Studio… Could you please help?
It works, however I cant attach any files, the error is:
Outlook: something went wrong, You may want to try it again
Can you please help me to solve it?
King Regards,
Boris
Hello @Ashraya, thank you for sharing your custom activity.
I am considering to use this in client’s environment, do you have it in UiPath Marketplace or else so that I can explain the reliability to the client?