Enumerations (JavaScript API for Office)

apps for Office

Last modified: February 25, 2015

Enumerations of the JavaScript API for Office.

You can specify an enumerated value by using either its fully qualified enumeration name (Office.CoercionType.Text) or its corresponding text value ("text"). For example, the following method call uses enumeration names:

Office.context.document.getSelectedDataAsync(Office.CoercionType.Text, {valueFormat:Office.ValueFormat.Unformatted, filterType:Office.FilterType.All}, 
   function (result) {
      if (result.status === Office.AsyncResultStatus.Success)      
         var dataValue = result.value; // Get selected data.
         write('Selected data is ' + dataValue);
      else {            
         var err = result.error; 
         write(err.name + ": " + err.message);
      }
   });

// Function that writes to a div with id='message' on the page.
function write(message){
    document.getElementById('message').innerText += message; 
}

Here's the same call using the enumeration text values:

Office.context.document.getSelectedDataAsync("text", {valueFormat:"unformatted", filterType:"all"}, 
   function (result) {
      if (result.status === "success")      
         var dataValue = result.value; // Get selected data.
         write('Selected data is ' + dataValue);
      else {            
         var err = result.error; 
         write(err.name + ": " + err.message);
      }
   });

Name

Definition

ActiveView

Specifies the state of the active view of the document, for example, whether the user can edit the document.

AsyncResultStatus

Specifies the result of an asynchronous call.

AttachmentType

Specifies the type of an attachment to an email message or meeting request. Outlook 2013 does not support this enumeration.

BindingType

Specifies the type of the binding object that should be returned.

BodyType

Specifies the text type for the body of an appointment or message.

CoercionType

Specifies how to coerce data returned or set by the invoked method.

CustomXMLNodeType

Specifies the node type.

DocumentMode

Specifies whether the document in associated application is read-only or read-write.

EntityType

Specifies an entity's type.

EventType

Specifies the kind of event that was raised.

FileType

Specifies the format in which to return the document.

GoToType

Specifies the type of place or object to navigate to.

FilterType

Specifies whether filtering from the host application is applied when the data is retrieved.

InitializationReason

Specifies whether the app was just inserted or was already contained in the document.

ItemType

Specifies an item's type.

ProjectProjectFields

Specifies the project fields that are available as a parameter for the getProjectFieldAsync method.

ProjectResourceFields

Specifies the resource fields that are available as a parameter for the getResourceFieldAsync method.

ProjectTaskFields

Specifies the task fields that are available as a parameter for the getTaskFieldAsync method.

ProjectViewTypes

Specifies the types of views that the getSelectedViewAsync method can recognize.

RecipientType

Specifies the type of recipient for an appointment.

ResponseType

Specifies the response to a meeting invitation.

ValueFormat

Specifies whether values, such as numbers and dates, returned by the invoked method are returned with their formatting applied.

Support for each enumeration differs across Office host applications. See the "Support details" section of each enumerations's topic for host support information.

For more information about Office host application and server requirements, see Requirements for running apps for Office.

App types

Content, mail, task pane

Library

Office.js

Namespace

Office

Show:
© 2015 Microsoft