如何在 Outlook 撰写表单中设置多个位置?

How to set multiple locations in Outlook compose form?

我目前正在使用 Microsoft Graph API 开发 Angular outlook 插件。我必须以撰写形式设置和获取 Outlook 项目数据。我提到 link Get and set data items in outlook compse form 这样做。在位置的情况下,我使用

Office.context.mailbox.item.location.setAsync('LocationA');

但它只需要字符串。在多个位置的情况下,我不能使用这个 属性。有没有其他方法可以在 Outlook 撰写表单中实现多个位置的设置?

您可以使用 EnhancedLocation Preview API to set one or more locations that are associated with email ids. You need to use addAsync 并将要添加到当前位置列表的位置作为 locationIdentifiers 传递。

Office.context.mailbox.item.enhancedLocation

在阅读和撰写模式下,enhancedlocation 将 return 一个 EnhancedLocation 类型的对象,您可以对其执行 add/get/remove 操作。

var locations = [
    {
        "id": "ConfRoom101@contoso.com",
        "type": Office.MailboxEnums.LocationType.Room
    }
];
Office.context.mailbox.item.enhancedLocation.addAsync(locations);

另请注意,此 API 是为开发人员提供的预览版,可能会根据反馈进行更改。明智的做法是不要在生产环境中使用此 API。