High Importance flag in outlook

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

Hi @dineshbabu8k,

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

Regards,
Rahamat

Hi Rahamat,

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

Regards,
Dinesh

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”

1 Like

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.

1 Like

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

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

Sorry for the delayed response.

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?

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

Yes…

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.

4 Likes

Thank you!

Why don’t you UiPath people include this option in “Send Outlook Mail Message” activity then?

2 Likes

Any update on this??? I need to set High importance on “Get Outlook Mail Message”. Anyone 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?

Thank you in advance for considering.