首页 > 解决方案 > Outlook 插件:messageCompose vs message

问题描述

我试图找出当前在 Outlook 中打开的电子邮件是 messageCompose 还是 message 类型(即,我的插件试图确定用户是在写电子邮件还是在阅读电子邮件)。

在这两种情况下,Office.context.mailbox.item.itemType 都是“消息”

但是,当我 console.log(Office.context.mailbox.item)在此处输入图像描述如果我正在阅读电子邮件,我会在 chrome inspect (r.message)中看到以下内容,在此处输入图像描述如果我正在撰写电子邮件,我会在 (r.messageCompose) 中看到以下内容。

基本上我想要的是

if(I am writing an email) {
 // do stuff
}
if(I am reading an email) {
 // do other stuff
}

另外,有没有办法区分撰写新消息和回复消息?

我正在使用 Angular 7。

标签: angularoutlook-addinoffice-addinsoutlook-web-addins

解决方案


推荐阅读