Office.SelectedItemDetails interface
Represents the properties of a message that's currently selected in Outlook.
Remarks
Minimum permission level: read/write mailbox
Applicable Outlook mode: 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-message-properties.yaml
// Retrieves the selected messages' properties and logs them to the console.
Office.context.mailbox.getSelectedItemsAsync((asyncResult) => {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.log(asyncResult.error.message);
return;
}
asyncResult.value.forEach((message) => {
console.log(`Item ID: ${message.itemId}`);
console.log(`Conversation ID: ${message.conversationId}`);
console.log(`Internet message ID: ${message.internetMessageId}`);
console.log(`Subject: ${message.subject}`);
console.log(`Item type: ${message.itemType}`);
console.log(`Item mode: ${message.itemMode}`);
console.log(`Has attachment: ${message.hasAttachment}`);
});
});
Properties
conversation |
The identifier of the message conversation that contains the message that's currently selected. |
has |
Returns |
internet |
The internet message identifier of the message that's currently selected. |
item |
The Exchange Web Services (EWS) item identifier of the message that's currently selected. |
item |
The Outlook mode ( |
item |
The type of the item that's currently selected. |
subject | The description that appears in the subject field of the message that's currently selected. |
Property Details
conversationId
The identifier of the message conversation that contains the message that's currently selected.
conversationId: string;
Property Value
string
Remarks
Minimum permission level: read/write mailbox
Applicable Outlook mode: Message Compose, Message Read
hasAttachment
Returns true
if the message that's currently selected contains an attachment.
hasAttachment: boolean;
Property Value
boolean
Remarks
Minimum permission level: read/write mailbox
Applicable Outlook mode: Message Compose, Message Read
internetMessageId
The internet message identifier of the message that's currently selected.
internetMessageId: string;
Property Value
string
Remarks
Minimum permission level: read/write mailbox
Applicable Outlook mode: Message Compose, Message Read
itemId
The Exchange Web Services (EWS) item identifier of the message that's currently selected.
itemId: string;
Property Value
string
Remarks
Minimum permission level: read/write mailbox
Applicable Outlook mode: Message Compose, Message Read
itemMode
The Outlook mode (Read
or Compose
) of the message that's currently selected.
itemMode: string;
Property Value
string
Remarks
Minimum permission level: read/write mailbox
Applicable Outlook mode: Message Compose, Message Read
itemType
The type of the item that's currently selected. Message
is the only supported type at this time.
itemType: MailboxEnums.ItemType | string;
Property Value
Office.MailboxEnums.ItemType | string
Remarks
Minimum permission level: read/write mailbox
Applicable Outlook mode: Message Compose, Message Read
subject
The description that appears in the subject field of the message that's currently selected.
subject: string;
Property Value
string
Remarks
Minimum permission level: read/write mailbox
Applicable Outlook mode: Message Compose, Message Read
Office Add-ins