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

Roger Sæle 1 Reputation point
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?

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
865 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,473 questions
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