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

Roger Sæle 21 Reputation points
2021-10-21T08:07:47.773+00:00

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?

Microsoft 365 and Office Development Office JavaScript API
Microsoft 365 and Office Development Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Petra Ronald 26 Reputation points Microsoft Employee
    2021-11-05T16:50:00.58+00:00

    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://learn.microsoft.com/javascript/api/outlook/office.customproperties?view=outlook-js-preview

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.