Is it possible to retrieve the body of the email being replied to in a conversation outlook add-in?

33 views Asked by At

Is it possible to retrieve the body of the email being replied to in a conversation even we have multiple emails in conversation.

I am attempting to retrieve the email body in compose mode for an Outlook add-in using office.js/MS Graph. However, I'm not able to obtain the specific email body from the conversation when I click to reply. Can anyone help me to write JavaScript solution for this?

I tried this API https://graph.microsoft.com/v1.0/me/messages?$filter=conversationId eq '${conversationId}' but it is fetching whole conversation, but I want only body of the specific email which I want to reply.

2

There are 2 answers

0
Eugene Astafiev On

The JavaScript API for Office (OfficeJS) doesn't provide anything for that. The best what you can do is to try to explore what MS Graph API provides for dealing with conversations. Office web add-ins deal with with currently opened item only, i.e. work under the context of currently opened or composed item only.

Also you may try to parse the message body text and extract the required part on your own.

1
Harold Marin Salazar On

You got 3 road to follow, you need to configure the Outlook to save the mail of the "Inbox" in your PC and use .net to get the track of what do you want to save,also you can use the VSTO(Visual Studio Tools) to create something like a complemment to outlook to make a "security copy" of the mail(use C# or C++),If you have licence I recomend use Power automate to save a copy of the mail in sharepoin or OneDrive, way easy and works online in real time, also you do not have to script anything and yo can crear alerts on your phone to check when something is saved