简体   繁体   English

Outlook Office 365 AddIn:如何在回复中获取消息文本和传入消息?

[英]Outlook Office 365 AddIn: How to get the message text and the incoming message in a reply?

We have implemented an Office 365 AddIn for Outlook that analyzes per click the email text of an incoming message or a new message. 我们已经实施了Office 365 AddIn for Outlook,可以按点击分析传入邮件或新邮件的电子邮件文本。 Now we want to analyze the text that the user enters in a reply, and for this we need the entered text and (ideally separated) the text of the incoming message. 现在我们要分析用户在回复中输入的文本,为此我们需要输入的文本和(理想情况下是分开的)传入消息的文本。 But no function (as we know ) does fit our needs. 但是没有功能(我们知道)确实符合我们的需求。

The function 功能

this.item.body.getAsync(Office.CoercionType.Text, function cb(asyncResult) {
...

specifies both the reply text and the text of the incoming message in a version that is not reasonable to fit and that is also only "similar" to the original mail. 在不合适的版本中指定回复文本和传入消息的文本,并且它也仅与原始邮件“相似”。

Example of one result of the this.item.body function getting the reply: 获得回复的this.item.body函数的一个结果示例:

This is a test  <--- this is a reply text
              This is the start of the incoming message
                v
Von: Office 365 Message Center <o365mc@microsoft.com>
Gesendet: Dienstag, 9. April 2019 21:15
An: Wilhelm Vortisch
Betreff: Message Center Major Change Update Notification
...

Try to parse this text "apart" have failed, because this text is not the "original" reply message and our Outlook AddIn can be activated after the user typed in something for the reply. 尝试解析此文本“分开”失败,因为此文本不是“原始”回复消息,我们的Outlook AddIn可以在用户输入回复激活。

I think the only feasible solution to this is to parse out the message body to find the reply email's text. 我认为唯一可行的解​​决方案是解析邮件正文以查找回复电子邮件的文本。 You can look for the divRplyFwdMsg DIV and the content will be within that tag. 您可以查找divRplyFwdMsg DIV,内容将在该标记内。

The only other option is to use the ConversationID with Graph to find the original message in the containing folder, but that would be a bit of a guess to find the email in the thread that was actually replied to (the newest may be the source, but not always). 唯一的另一个选择是使用带有Graph的ConversationID来查找包含文件夹中的原始消息,但是在实际回复的线程中查找电子邮件会有点猜测(最新的可能是源,但不总是)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM