Office.SelectedItemDetails interface

Represents the properties of a message that's currently selected in Outlook.

Remarks

[ API set: Mailbox 1.13 ]

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

conversationId

The identifier of the message conversation that contains the message that's currently selected.

hasAttachment

Returns true if the message that's currently selected contains an attachment.

internetMessageId

The internet message identifier of the message that's currently selected.

itemId

The Exchange Web Services (EWS) item identifier of the message that's currently selected.

itemMode

The Outlook mode (Read or Compose) of the message that's currently selected.

itemType

The type of the item that's currently selected. Message is the only supported type at this time.

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

[ API set: Mailbox 1.14 ]

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

[ API set: Mailbox 1.14 ]

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

[ API set: Mailbox 1.14 ]

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

[ API set: Mailbox 1.13 ]

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

[ API set: Mailbox 1.13 ]

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

Remarks

[ API set: Mailbox 1.13 ]

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

[ API set: Mailbox 1.13 ]

Minimum permission level: read/write mailbox

Applicable Outlook mode: Message Compose, Message Read