Office.Item interface
项目命名空间用于访问当前选定的消息、会议请求或约会。 可以使用属性确定项 itemType 的类型。
如果只想查看特定类型或模式的 IntelliSense,请将此项目强制转换为以下内容之一:
注解
最低权限级别: 受限
适用的Outlook模式:约会组织者,约会与会者,Message Compose,消息已读
使用方
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-item-type.yaml
const itemType = Office.context.mailbox.item.itemType;
switch (itemType) {
case Office.MailboxEnums.ItemType.Appointment:
console.log(`Current item is an ${itemType}.`);
break;
case Office.MailboxEnums.ItemType.Message:
console.log(`Current item is a ${itemType}. A message could be an email, meeting request, meeting response, or meeting cancellation.`);
break;
}