Att*_*tti 9 javascript office-js
我正在使用addFileAttachmentAsync将图像添加为Outlook 2016中的电子邮件附件.有没有办法指定附件选项?我看到有一个 AttachmentDetail类型,我可以以某种方式使用这个来指定其他选项吗?我的目标是使用multipart/related MIME对象嵌入图像.
小智 5
内联图像目前在平台上没有很好的支持.我们正在努力改善这一点.在此期间,您可以包含<img>从Web加载图像的标记,也可以使用此代码.在OWA中,发件人将看到附件出现在附件中,在Outlook中,图像根本不会为发件人呈现.但在这两种情况下,收件人都会看到正确的内嵌图像.
Office.context.mailbox.item.addFileAttachmentAsync(
"http://smartbuildings.unh.edu/wp-content/uploads/2015/06/Winter-Tiger-Wild-Cat-Images-1024x576.jpg",
"Winter-Tiger-Wild-Cat-Images-1024x576.jpg",
{asyncContext: null},
function (asyncResult)
{
if (asyncResult.status == "failed") {
//showMessage("Action failed with error: " + asyncResult.error.message);
}
else
{
Office.context.mailbox.item.body.setSelectedDataAsync(
"<img src='cid:Winter-Tiger-Wild-Cat-Images-1024x576.jpg'>",
{ coercionType: Office.CoercionType.Html,
asyncContext: { var3: 1, var4: 2 } },
function (asyncResult) {
if (asyncResult.status ==
Office.AsyncResultStatus.Failed){
showMessage(asyncResult.error.message);
}
else {
// Successfully set data in item body.
// Do whatever appropriate for your scenario,
// using the arguments var3 and var4 as applicable.
}
});
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
349 次 |
| 最近记录: |