Office.Item interface
The item namespace is used to access the currently selected message, meeting request, or appointment. You can determine the type of the item by using the itemType
property.
To see the full member list, refer to the Object Model page.
If you want to see IntelliSense for only a specific type or mode, cast this item to one of the following:
Remarks
Minimum permission level: restricted
Applicable Outlook mode: Appointment Organizer, Appointment Attendee, Message Compose, Message Read
Examples
// 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;
}
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Office Add-ins