Modify the subject of a mail

Hello,

I’m trying to replace the subject of a mail in my Inbox without using the lib Alphabet.
The goal is to replace the subject on the inbox, not to replace the subject and forward the mail,

I’m stucked with this so if someone have an idea i greatly welcome it :smiley:

Regards,

I’m pretty certain you can’t. Outlook doesn’t have edit capabilities on existing emails. You can only control the subject of a new email.

Thanks for your reply but what i am trying to do is to replace an activity that does this (the package is using uipath.system.activites 18.4, it’s the reason why we want to change this)

@Yamatendo Can you please try the below attached workflow by sending mailmessage object & new subject as arguments
UipathTeam.Activites.Outlook_ChangeMailSubject.zip (2.6 KB)

4 Likes

What activity allows you to edit the subject of an existing email?

It’s in the Alphabet package and it’s called change outlook mail subject

1 Like

Thanks ! It was exactly what i tried to do but i didn’t find the convertion of mailmessage to mailitem and it seems that it was hard to find.
I marked your reply as solution :slight_smile:

Have a nice day,

Regards,

Nice solution can you please explain for better understanding

Dim OlApp As Microsoft.Office.Interop.Outlook.Application
Dim MailItem As microsoft.Office.Interop.Outlook.MailItem
OlApp = New Microsoft.Office.Interop.Outlook.ApplicationClass
MailItem = CType(olapp.Session.GetItemFromID(in_MailMessage.Headers(“uid”)),microsoft.Office.Interop.Outlook.MailItem)
MailItem.Subject=in_NewSubject
MailItem.Save()

The Below code was written in vb.net using interop dll.

Dim OlApp As Microsoft.Office.Interop.Outlook.Application // declaring outlook application
Dim MailItem As microsoft.Office.Interop.Outlook.MailItem // declaring mail item
OlApp = New Microsoft.Office.Interop.Outlook.ApplicationClass // intializing outlook application object.
MailItem = CType(olapp.Session.GetItemFromID(in_MailMessage.Headers(“uid”)),microsoft.Office.Interop.Outlook.MailItem) //using uid of mailmessage headers type casting into mail item type.
MailItem.Subject=in_NewSubject // changing to new subject.
MailItem.Save()// saving mail message item

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.