office.js,office.context.mailbox.item.cc.getAsync不起作用
我正在努力使用Office-JS创建Outlook加载项。
我需要获取CC和电子邮件。
由于我阅读了这些页面,所以我编写了此代码。但是,当cc.getAsync和to.getAsync毫无用处时,getAsync返回收集消息的身体。 https://learn.microsoft.com/ja-jp/javascript/api/requirement-sets/requirement-sets/requirement-setlook/requirement-set-set-set-1.5/office.context.context.mailbox.mailbox.itembox.item? JS-Preview https://learn.microsoft.com/en-us/javascript/api/opi/oflook/office.recipients?view=Outlook-js-1.5&ppreserve-view = True
// It does not work though I expect to appear cc of the message on taskpane of my add-in
const item = Office.context.mailbox.item;
item.cc.getAsync(function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
document.getElementById("message").innerHTML = `<h2 class="message">${asyncResult.value}</h2>`;
document.getElementById("message").style.visibility = "visible";
}
});
// same here
const item = Office.context.mailbox.item;
item.to.getAsync(function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
document.getElementById("message").innerHTML = `<h2 class="message">${asyncResult.value}</h2>`;
document.getElementById("message").style.visibility = "visible";
}
});
// on the other hand, I can see the body of the message on my taskpane
item.body.getAsync(Office.CoercionType.Html, function callback(result) {
if (result.status === Office.AsyncResultStatus.Succeeded) {
document.getElementById("message").innerHTML = `<h2 class="message">${result.value}</h2>`;
document.getElementById("message").style.visibility = "visible";
}
});
I'm working to create a Outlook add-in using office-js.
I need to get cc and to of an e-mail message.
Since I read these pages, I write this code. However, when cc.getAsync and to.getAsync works nothing whereas body.getAsync returns collect body of the message.
https://learn.microsoft.com/ja-jp/javascript/api/requirement-sets/outlook/requirement-set-1.5/office.context.mailbox.item?view=common-js-preview
https://learn.microsoft.com/en-us/javascript/api/outlook/office.recipients?view=outlook-js-1.5&preserve-view=true
// It does not work though I expect to appear cc of the message on taskpane of my add-in
const item = Office.context.mailbox.item;
item.cc.getAsync(function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
document.getElementById("message").innerHTML = `<h2 class="message">${asyncResult.value}</h2>`;
document.getElementById("message").style.visibility = "visible";
}
});
// same here
const item = Office.context.mailbox.item;
item.to.getAsync(function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
document.getElementById("message").innerHTML = `<h2 class="message">${asyncResult.value}</h2>`;
document.getElementById("message").style.visibility = "visible";
}
});
// on the other hand, I can see the body of the message on my taskpane
item.body.getAsync(Office.CoercionType.Html, function callback(result) {
if (result.status === Office.AsyncResultStatus.Succeeded) {
document.getElementById("message").innerHTML = `<h2 class="message">${result.value}</h2>`;
document.getElementById("message").style.visibility = "visible";
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论