High Importance flag in outlook

studio

#1

Hi,

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.

Anyone please help me in this issue…

Thanks in advance.
Priority


Flag email as "High Priority" in Send outlook mail
#2

Hi @dineshbabu8k,

Did you check this existing topic? It might help you.

Regards,
Rahamat


#3

Hi Rahamat,

I already checked the link which you provided. There is no solution given in that thread.

Regards,
Dinesh


#4

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”


#5

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.


#6

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!!!


#7

Hi, you can import the outlook namespace from the import tab in the studio.

Sorry for the delayed response.


#8

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…
image

The errors are still there after I restarted my Studio… Could you please help?


#9

Sorry for the delay. Are you still having trouble with this?


#10

Yes…


#11

ActivitiesCustomOutlook.1.0.0.nupkg (6.3 KB)

You can use the attached custom activity which will enable you to set the importance to the mail.
Let knw if you face any issues using the activity.