question

RogerSle-7423 avatar image
0 Votes"
RogerSle-7423 asked PetraRonald-5920 answered

Is it possible to use Office Javascript API to set subject of selected email in Outlook?

With VSTO add-in I can change the subject of the selected email. To prepend something like a ticket number, for instance. But this does not seem possible with the Javascript API. It looks like I have to be in compose mode for this, which is not what I want.

Does Office.context.mailbox.item.subject.setAsync only work in compose mode? Or can I somehow make it work for the selected item/email? Or is there any other way to change the subject of the selected email?

office-addins-devoffice-js-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PetraRonald-5920 avatar image
0 Votes"
PetraRonald-5920 answered

Office.context.mailbox.item.subject.setAsync only works in compose mode. You can set properties on the email using custom properties though if that works for your scenario: https://docs.microsoft.com/javascript/api/outlook/office.customproperties?view=outlook-js-preview

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.