item (Mailbox preview requirement set)

Office.context.mailbox.item

item 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.

Requirements
Requirement Value
Minimum mailbox requirement set version 1.1
Minimum permission level Restricted
Applicable Outlook mode Appointment Organizer, Appointment Attendee,
Message Compose, or Message Read

Properties

Property Minimum
permission level
Details by mode Return type Minimum
requirement set
attachments ReadItem Appointment Attendee Array.<AttachmentDetails> 1.1
Message Read Array.<AttachmentDetails> 1.1
bcc ReadItem Message Compose Recipients 1.1
body ReadItem Appointment Organizer Body 1.1
Appointment Attendee Body 1.1
Message Compose Body 1.1
Message Read Body 1.1
categories ReadItem Appointment Organizer Categories 1.8
Appointment Attendee Categories 1.8
Message Compose Categories 1.8
Message Read Categories 1.8
cc ReadItem Message Compose Recipients 1.1
Message Read Array.<EmailAddressDetails> 1.1
conversationId ReadItem Message Compose String 1.1
Message Read String 1.1
dateTimeCreated ReadItem Appointment Attendee Date 1.1
Message Read Date 1.1
dateTimeModified ReadItem Appointment Attendee Date 1.1
Message Read Date 1.1
end ReadItem Appointment Organizer Time 1.1
Appointment Attendee Date 1.1
Message Read
(Meeting Request)
Date 1.1
enhancedLocation ReadItem Appointment Organizer EnhancedLocation 1.8
Appointment Attendee EnhancedLocation 1.8
from ReadWriteItem Message Compose From 1.7
ReadItem Message Read EmailAddressDetails 1.1
internetHeaders ReadItem Message Compose InternetHeaders 1.8
internetMessageId ReadItem Message Read String 1.1
isAllDayEvent ReadItem Appointment Organizer IsAllDayEvent Preview
Appointment Attendee Boolean Preview
itemClass ReadItem Appointment Attendee String 1.1
Message Read String 1.1
itemId ReadItem Appointment Attendee String 1.1
Message Read String 1.1
itemType ReadItem Appointment Organizer MailboxEnums.ItemType 1.1
Appointment Attendee MailboxEnums.ItemType 1.1
Message Compose MailboxEnums.ItemType 1.1
Message Read MailboxEnums.ItemType 1.1
location ReadItem Appointment Organizer Location 1.1
Appointment Attendee String 1.1
Message Read
(Meeting Request)
String 1.1
normalizedSubject ReadItem Appointment Attendee String 1.1
Message Read String 1.1
notificationMessages ReadItem Appointment Organizer NotificationMessages 1.3
Appointment Attendee NotificationMessages 1.3
Message Compose NotificationMessages 1.3
Message Read NotificationMessages 1.3
optionalAttendees ReadItem Appointment Organizer Recipients 1.1
Appointment Attendee Array.<EmailAddressDetails> 1.1
organizer ReadWriteItem Appointment Organizer Organizer 1.7
ReadItem Appointment Attendee EmailAddressDetails 1.1
recurrence ReadItem Appointment Organizer Recurrence 1.7
Appointment Attendee Recurrence 1.7
Message Read
(Meeting Request)
Recurrence 1.7
requiredAttendees ReadItem Appointment Organizer Recipients 1.1
Appointment Attendee Array.<EmailAddressDetails> 1.1
sender ReadItem Message Read EmailAddressDetails 1.1
sensitivity ReadItem Appointment Organizer Sensitivity Preview
Appointment Attendee MailboxEnums.AppointmentSensitivityType Preview
seriesId ReadItem Appointment Organizer String 1.7
Appointment Attendee String 1.7
Message Compose String 1.7
Message Read String 1.7
sessionData ReadItem Appointment Organizer SessionData Preview
Message Compose SessionData Preview
start ReadItem Appointment Organizer Time 1.1
Appointment Attendee Date 1.1
Message Read
(Meeting Request)
Date 1.1
subject ReadItem Appointment Organizer Subject 1.1
Appointment Attendee String 1.1
Message Compose Subject 1.1
Message Read String 1.1
to ReadItem Message Compose Recipients 1.1
Message Read Array.<EmailAddressDetails> 1.1

Methods

Method Minimum
permission level
Details by mode Minimum
requirement set
addFileAttachmentAsync(uri, attachmentName, [options], [callback]) ReadWriteItem Appointment Organizer 1.1
Message Compose 1.1
addFileAttachmentFromBase64Async(base64File, attachmentName, [options], [callback]) ReadWriteItem Appointment Organizer 1.8
Message Compose 1.8
addHandlerAsync(eventType, handler, [options], [callback]) ReadItem Appointment Organizer 1.7
Appointment Attendee 1.7
Message Compose 1.7
Message Read 1.7
addItemAttachmentAsync(itemId, attachmentName, [options], [callback]) ReadWriteItem Appointment Organizer 1.1
Message Compose 1.1
close() Restricted Appointment Organizer 1.3
Message Compose 1.3
disableClientSignatureAsync([options], [callback]) ReadWriteItem Appointment Organizer Preview
Message Compose Preview
displayReplyAllForm(formData) ReadItem Appointment Attendee 1.1
Message Read 1.1
displayReplyAllFormAsync(formData, [options], [callback]) ReadItem Appointment Attendee 1.9
Message Read 1.9
displayReplyForm(formData) ReadItem Appointment Attendee 1.1
Message Read 1.1
displayReplyFormAsync(formData, [options], [callback]) ReadItem Appointment Attendee 1.9
Message Read 1.9
getAllInternetHeadersAsync([options], [callback]) ReadItem Message Read 1.8
getAttachmentContentAsync(attachmentId, [options], [callback]) ReadItem Appointment Organizer 1.8
Appointment Attendee 1.8
Message Compose 1.8
Message Read 1.8
getAttachmentsAsync([options], [callback]) ReadItem Appointment Organizer 1.8
Message Compose 1.8
getComposeTypeAsync([options], callback) ReadItem Message Compose Preview
getEntities() ReadItem Appointment Attendee 1.1
Message Read 1.1
getEntitiesByType(entityType) Restricted Appointment Attendee 1.1
Message Read 1.1
getFilteredEntitiesByName(name) ReadItem Appointment Attendee 1.1
Message Read 1.1
getInitializationContextAsync([options], [callback]) ReadItem Appointment Organizer Preview
Appointment Attendee Preview
Message Compose Preview
Message Read Preview
getItemIdAsync([options], callback) ReadItem Appointment Organizer 1.8
Message Compose 1.8
getRegExMatches() ReadItem Appointment Attendee 1.1
Message Read 1.1
getRegExMatchesByName(name) ReadItem Appointment Attendee 1.1
Message Read 1.1
getSelectedDataAsync(coercionType, [options], callback) ReadItem Appointment Organizer 1.2
Message Compose 1.2
getSelectedEntities() ReadItem Appointment Attendee 1.6
Message Read 1.6
getSelectedRegExMatches() ReadItem Appointment Attendee 1.6
Message Read 1.6
getSharedPropertiesAsync([options], callback) ReadItem Appointment Organizer 1.8
Appointment Attendee 1.8
Message Compose 1.8
Message Read 1.8
isClientSignatureEnabledAsync([options], callback) ReadItem Appointment Organizer Preview
Message Compose Preview
loadCustomPropertiesAsync(callback, [userContext]) ReadItem Appointment Organizer 1.1
Appointment Attendee 1.1
Message Compose 1.1
Message Read 1.1
removeAttachmentAsync(attachmentId, [options], [callback]) ReadWriteItem Appointment Organizer 1.1
Message Compose 1.1
removeHandlerAsync(eventType, [options], [callback]) ReadItem Appointment Organizer 1.7
Appointment Attendee 1.7
Message Compose 1.7
Message Read 1.7
saveAsync([options], callback) ReadWriteItem Appointment Organizer 1.3
Message Compose 1.3
setSelectedDataAsync(data, [options], callback) ReadWriteItem Appointment Organizer 1.2
Message Compose 1.2

Events

You can subscribe to and unsubscribe from the following events using addHandlerAsync and removeHandlerAsync respectively.

Event Description Minimum
requirement set
AppointmentTimeChanged The date or time of the selected appointment or series has changed. 1.7
AttachmentsChanged An attachment has been added to or removed from the item. 1.8
EnhancedLocationsChanged The location of the selected appointment has changed. 1.8
RecipientsChanged The recipient list of the selected item or appointment location has changed. 1.7
RecurrenceChanged The recurrence pattern of the selected series has changed. 1.7

Example

The following JavaScript code example shows how to access the subject property of the current item in Outlook.

// The initialize function is required for all apps.
Office.initialize = function () {
  // Checks for the DOM to load using the jQuery ready function.
  $(document).ready(function () {
    // After the DOM is loaded, app-specific code can run.
    var item = Office.context.mailbox.item;
    var subject = item.subject;
    // Continue with processing the subject of the current item,
    // which can be a message or appointment.
  });
};