gpt4 book ai didi

office-js - 在 Outlook 邮件中发送邮件后,itemId 正在更改

转载 作者:行者123 更新时间:2023-12-03 21:03:53 24 4
gpt4 key购买 nike

我收到 itemId saveAsync 之后的邮件项目在撰写模式下。

发送邮件项目后,项目 Id进来 Office.context.mailbox.item.itemId与撰写模式中给出的不同。

用于获取的代码 itemId在撰写模式下:

var itemId = Office.context.mailbox.item.itemId;
if (itemId === null || itemId == undefined) {
Office.context.mailbox.item.saveAsync(function (result) {
itemId = result.value;
});
}

邮件发送后,我验证了邮件的 itemId从发送箱使用:
`Office.context.mailbox.item.itemId`

令我惊讶的是它是不同的。

根据 documentation , itemId应该是一样的:

The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function.



我做错了什么?

最佳答案

首先,重要的是要了解项目的 itemId不是静态值。每当项目在 Exchange 中移动时,ID 都会更改。来自 EWS documentation :

Identifiers in Exchange are opaque. For example, the EwsId is created from several pieces of information that are not important to you as the developer, but are important to Exchange.



至于为什么会这样,是因为 saveAsync将导调用子邮件被保存到草稿文件夹。发送时,该项目首先移至发件箱,然后移至已发送项目文件夹。这些文件夹中的每一个更改(草稿、发件箱和已发送邮件)都会导致 itemId 的更改。 field 。

关于office-js - 在 Outlook 邮件中发送邮件后,itemId 正在更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46076151/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com