UNPKG

@microsoft/office-js

Version:
1,164 lines (1,107 loc) • 78.2 kB
/* Version: 16.0.8828.1000 */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ /* Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. */ Office._appMode = { Read: 1, Compose: 2, ReadCompose: 3 } Office._cast_item = function () { this.toAppointmentCompose = function (item) { return new Office._$MailboxAppointment(Office._appMode.Compose); } this.toAppointmentRead = function (item) { return new Office._$MailboxAppointment(Office._appMode.Read); } this.toAppointment = function (item) { return new Office._$MailboxAppointment(Office._appMode.ReadCompose); } this.toMessageCompose = function (item) { return new Office._$MailboxMessage(Office._appMode.Compose); } this.toMessageRead = function (item) { return new Office._$MailboxMessage(Office._appMode.Read); } this.toMessage = function (item) { return new Office._$MailboxMessage(Office._appMode.ReadCompose); } this.toItemCompose = function (item) { return new Office._$MailboxItem(Office._appMode.Compose); } this.toItemRead = function (item) { return new Office._$MailboxItem(Office._appMode.Read); } }; Office._context_mailbox_item = function () { Office._$MailboxItem_helper(this, Office._appMode.ReadCompose); Office._$MailboxAppointment_helper(this, Office._appMode.ReadCompose); Office._$MailboxMessage_helper(this, Office._appMode.ReadCompose); }; Office._$MailboxItem = function (appMode) { Office._$MailboxItem_helper(this, appMode); Office._$MailboxAppointment_helper(this, appMode); Office._$MailboxMessage_helper(this, appMode); } Office._$MailboxAppointment = function (appMode) { Office._$MailboxItem_helper(this, appMode); Office._$MailboxAppointment_helper(this, appMode); } Office._$MailboxMessage = function (appMode) { Office._$MailboxItem_helper(this, appMode); Office._$MailboxMessage_helper(this, appMode); } Office._$MailboxItem_helper = function (obj, appMode) { // Field documentation ------------------------------------------ // Attachments property. attachmentsDoc = { attachments_read: { conditions: { hosts: ["outlook; not outlookcompose"] }, name: "attachments", annotate: { ///<field name="attachments" type='AttachmentDetails[]'>Gets a list of attachments to the item.</field> attachments: undefined }, contents: function () { return new Array(new Office._context_mailbox_item_attachmentDetails()) } }, attachments_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "attachments", annotate: { ///<field name="attachments">Gets a list of attachments to the item. In compose mode the attachments property is undefined. In read mode it returns a list of attachments to the item.</field> attachments: undefined }, contents: function () { return new Array(new Office._context_mailbox_item_attachmentDetails()) } } } bodyDoc = { body_compose: { conditions: { hosts: ["not outlook, outlookcompose"] }, name: "body", annotate: { /// <field name="body" type='Body'>Provides methods to get and set the body of the item.</field> body: undefined }, contents: function () { return new Office._context_mailbox_item_body() } }, body_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "body", annotate: { /// <field name="body"> Gets the content of an item. In read mode, the body property is undefined. In compose mode it returns a Body object.</field> body: undefined }, contents: function () { return new Office._context_mailbox_item_body() } } } // dateTimeCreated property. dateTimeCreatedDoc = { dateTimeCreated_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "dateTimeCreated", annotate: { ///<field name="dateTimeCreated" type='Date'>Gets the date and time that the item was created.</field> dateTimeCreated: undefined }, contents: function () { return new Date() } }, dateTimeCreated_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "dateTimeCreated", annotate: { ///<field name="dateTimeCreated" type='Date'>Gets the date and time that the item was created. In compose mode the dateTimeCreated property is undefined.</field> dateTimeCreated: undefined }, contents: function () { return new Date() } } } // dateTimeModified property. dateTimeModifiedDoc = { dateTimeModified_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "dateTimeModified", annotate: { ///<field name="dateTimeModified" type='Date'>Gets the date and time that the item was last modified.</field> dateTimeModified: undefined }, contents: function () { return new Date() } }, dateTimeModified_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "dateTimeModified", annotate: { ///<field name="dateTimeModified" type='Date'>Gets the date and time that the item was last modified. In compose mode the dateTimeModified property is undefined.</field></field> dateTimeModified: undefined }, contents: function () { return new Date() } } } // itemClass property. itemClassDoc = { itemClass_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "itemClass", annotate: { ///<field name="itemClass" type='String'>Gets the item class of the item.</field> itemClass: undefined } }, itemClass_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "itemClass", annotate: { ///<field name="itemClass" type='String'>Gets the item class of the item. In compose mode the itemClass property is undefined.</field> itemClass: undefined } } } // itemId property // This property is in all modes, so it gets processed in place rather than // after the extra documentation is removed. Office._processContents(obj, { itemIdDoc: { conditions: { hosts: ["outlook", "outlookcompose"] }, name: "itemId", annotate: { ///<field name="itemId" type='String'>Gets the Exchange Web Services (EWS) item identifier of an item.</field> itemId: undefined } } }) // itemType property. Office._processContents(obj, { itemTypeDoc: { conditions: { hosts: ["outlook", "outlookcompose"] }, name: "itemType", annotate: { ///<field name="itemType" type='Office.MailboxEnums.ItemType'>Gets the type of an item that an instance represents.</field> itemType: undefined } } }) //obj.normalizedSubject = {}; normalizedSubjectDoc = { normalizedSubject_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "normalizedSubject", annotate: { ///<field name="normalizedSubject" type='String'>Gets the subject of the item, with standard prefixes removed.</field> normalizedSubject: undefined } }, normalizedSubject_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "normalizedSubject", annotate: { ///<field name="normalizedSubject" type='String'>Gets the subject of the item, with standard prefixes removed. In compose mode, the normalizedSubject property is undefined.</field> normalizedSubject: undefined } } } subjectDoc = { subject_compose: { conditions: { hosts: ["not outlook, outlookcompose"] }, name: "subject", annotate: { /// <field name="subject" type='Subject'>Provides methods to get and set the item subject.</field> subject: undefined }, contents: function () { return new Office._context_mailbox_item_subject() } }, subject_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "subject", annotate: { /// <field name="subject" type='String'>Gets the subject of the item.</field> subject: undefined } }, subject_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "subject", annotate: { /// <field name="subject"> Gets the subject of an item. In compose mode the Subject property returns a Subject object. In read mode, it returns a string.</field> subject: undefined } } } if (appMode == Office._appMode.Compose) { delete attachmentsDoc["attachments_read"]; delete attachmentsDoc["attachments_read_compose"]; delete bodyDoc.body_compose["conditions"]; delete bodyDoc["body_read_compose"]; delete dateTimeCreatedDoc["dateTimeCreated_read"]; delete dateTimeCreatedDoc["dateTimeCreated_read_compose"]; delete dateTimeModifiedDoc["dateTimeModified_read"]; delete dateTimeModifiedDoc["dateTimeModified_read_compose"]; delete itemClassDoc["itemClass_read"]; delete itemClassDoc["itemClass_read_compose"]; delete normalizedSubjectDoc["normalizedSubject_read"]; delete normalizedSubjectDoc["normalizedSubject_read_compose"]; delete subjectDoc.subject_compose["conditions"]; delete subjectDoc["subject_read"]; delete subjectDoc["subject_read_compose"]; } else if (appMode == Office._appMode.Read) { delete attachmentsDoc.attachments_read["conditions"]; delete attachmentsDoc["attachments_read_compose"]; delete bodyDoc["body_compose"]; delete bodyDoc["body_read_compose"]; delete dateTimeCreatedDoc.dateTimeCreated_read["conditions"]; delete dateTimeCreatedDoc["dateTimeCreated_read_compose"]; delete dateTimeModifiedDoc.dateTimeModified_read["conditions"]; delete dateTimeModifiedDoc["dateTimeModified_read_compose"]; delete itemClassDoc.itemClass_read["conditions"]; delete itemClassDoc["itemClass_read_compose"]; delete normalizedSubjectDoc.normalizedSubject_read["conditions"]; delete normalizedSubjectDoc["normalizedSubject_read_compose"]; delete subjectDoc.subject_read["conditions"]; delete subjectDoc["subject_compose"]; delete subjectDoc["subject_read_compose"]; } else if (appMode == Office._appMode.ReadCompose) { delete attachmentsDoc["attachments_read"]; delete attachmentsDoc.attachments_read_compose["conditions"]; delete bodyDoc["body_compose"]; delete bodyDoc.body_read_compose["conditions"]; delete dateTimeCreatedDoc["dateTimeCreated_read"]; delete dateTimeCreatedDoc.dateTimeCreated_read_compose["conditions"]; delete dateTimeModifiedDoc["dateTimeModified_read"]; delete dateTimeModifiedDoc.dateTimeModified_read_compose["conditions"]; delete itemClassDoc["itemClass_read"]; delete itemClassDoc.itemClass_read_compose["conditions"]; delete normalizedSubjectDoc["normalizedSubject_read"]; delete normalizedSubjectDoc.normalizedSubject_read_compose["conditions"]; delete subjectDoc["subject_compose"]; delete subjectDoc["subject_read"]; delete subjectDoc.subject_read_compose["conditions"]; } Office._processContents(obj, attachmentsDoc); Office._processContents(obj, bodyDoc); Office._processContents(obj, dateTimeCreatedDoc); Office._processContents(obj, dateTimeModifiedDoc); Office._processContents(obj, itemClassDoc); Office._processContents(obj, normalizedSubjectDoc); Office._processContents(obj, subjectDoc); if (appMode == Office._appMode.Compose || appMode == Office._appMode.ReadCompose) { obj.addFileAttachmentAsync = function (uri, attachmentName, options, callback) { ///<summary>Attach a file to an item.</summary> ///<param name="uri" type="String">A URI that provides the location of the file. Required.</param> ///<param name="attachmentName" type="String">The name to display while the attachment is loading. The name is limited to 256 characters. Required.</param> ///<param name="options" type="Object" optional="true">An optional parameters or state data passed to the callback method. Optional.</param> ///<param name="callback" type="function" optional="true">The method to invoke when the attachment finishes uploading. Optional.</param> var result = new Office._Mailbox_AsyncResult("attachmentAsync"); if (arguments.length == 3) { callback = options; } callback(result); }; obj.addItemAttachmentAsync = function (itemId, attachmentName, options, callback) { ///<summary>Attach an email item to an item.</summary> ///<param name="itemId" type="string">The Exchange identifier of the item to attach. The maximum length is 100 characters.</param> ///<param name="attachmentName" type="string">The name to display while the attachment is loading. The name is limited to 256 characters. </param> ///<param name="options" type="Object" optional="true">An optional parameters or state data passed to the callback method. </param> ///<param name="callback" type="function" optional="true">The method to invoke when the attachment finishes uploading. </param> var result = new Office._Mailbox_AsyncResult("attachmentAsync"); if (arguments.length == 3) { callback = options; } callback(result); }; obj.removeAttachmentAsync = function (attachmentIndex, options, callback) { ///<summary>Removes a file or item that was previously attached to an item.</summary> ///<param name="attachmentIndex" type="String">The index of the attachment to remove.</param> ///<param name="options" type="Object" optional="true">An optional parameters or state data passed to the callback method. </param> ///<param name="callback" type="function" optional="true">The method to invoke when the attachment is removed. </param> var result = new Office._Mailbox_AsyncResult("removeAttachmentAsync"); if (arguments.length == 2) { callback = options; } callback(result); }; Office._processItem(obj, { conditions: { reqs: ["set Mailbox GE 1.2"] }, metaOnly: true, contents: { getSelectedDataAsync: { value: function (coercionType, options, callback) { ///<summary>Gets the selected data in the subject or body of the current item; or null if not data is selected.</summary> ///<param name="coercionType" type="Office.CoercionType">One of the CoercionType enumeration values indicating whether the selected content is HTML or plain text.</param> ///<param name="options" type="Object" optional="true">Any optional parameters or state data passed to the method.</param> ///<param name="callback" type="function">The method to call when the asynchronous method is complete.</param> var result = new Office._Mailbox_AsyncResult("getSelectedDataAsync"); if (arguments.length == 2) { callback = options; } callback(result); } }, setSelectedDataAsync: { value: function (data, options, callback) { ///<summary>Sets the specified data in the subject or body of the current item.</summary> ///<param name="data" type='String'>The text to insert into the subject or body of the item.</param> ///<param name="options" type="Object" optional="true">Any optional parameters or state data passed to the method.</param> ///<param name="callback" type="function">The method to call when the asynchronous method is complete.</param> var result = new Office._Mailbox_AsyncResult(); if (arguments.length == 2) { callback = options; } callback(result); } } } }); } if (appMode == Office._appMode.Read || appMode == Office._appMode.ReadCompose) { obj.displayReplyAllForm = function (htmlBody) { ///<summary>Display a form for creating an email reply to all recipients.</summary> ///<param name="htmlBody" type="String">The HTML contents of the email reply. 32 KB limit.</param> }; obj.displayReplyForm = function (htmlBody) { ///<summary>Display a form for creating an email reply to the sender.</summary> ///<param name="htmlBody" type="String">The HTML contents of the email reply. 32 KB limit</param> }; Office._processItem(obj, { conditions: { reqs: ["set Mailbox GE 1.2"] }, metaOnly: true, contents: { displayReplyAllForm: { value: function (replyForm) { ///<summary>Display a form for creating an email reply to all recipients.</summary> ///<param name="replyForm" type='Object'>Syntax example: { ///&#10; &#34;body&#34;: &#34;...&#34; , ///&#10; &#34;attachments&#34;: [ ///&#10; { ///&#10; &#34;type&#34;:&#34;item&#34;, ///&#10; &#34;id&#34;:&#34;...&#34;, ///&#10; }, ///&#10; { ///&#10; &#34;type&#34;:&#34;file&#34;, ///&#10; &#34;name&#34;:&#34;...&#34;, ///&#10; &#34;url&#34;:&#34;...&#34;, ///&#10; } ///&#10; ]} ///&#10; body: HTML contents of the email reply. Optional, 32 KB limit. ///&#10; attachments: An array of JSON objects that are either file or item attachments. Optional. ///&#10; attachments:type: &#34;item&#34; to indicate that the attachment is an Exchange item, or &#34;file&#34; to indicate that the attachment is a file. ///&#10; attachments:id: The EWS identifier of the item to attach. 100 character limit. ///&#10; attachments:file: The file name of the file to attach. 255 character limit. ///&#10; attachments:url: The URL of the location where the file bytes are located. 2048 character limit. ///&#10; -or- ///&#10; The HTML contents of the email reply. 32 KB limit.</param> } }, displayReplyForm: { value: function (replyForm) { ///<summary>Display a form for creating an email reply to the sender.</summary> ///<param name="replyForm" type='Object'>Syntax example: { ///&#10; &#34;body&#34;: &#34;...&#34; , ///&#10; &#34;attachments&#34;: [ ///&#10; { ///&#10; &#34;type&#34;:&#34;item&#34;, ///&#10; &#34;id&#34;:&#34;...&#34;, ///&#10; }, ///&#10; { ///&#10; &#34;type&#34;:&#34;file&#34;, ///&#10; &#34;name&#34;:&#34;...&#34;, ///&#10; &#34;url&#34;:&#34;...&#34;, ///&#10; } ///&#10; ]} ///&#10; body: HTML contents of the email reply. Optional, 32 KB limit. ///&#10; attachments: An array of JSON objects that are either file or item attachments. Optional. ///&#10; attachments:type: &#34;item&#34; to indicate that the attachment is an Exchange item, or &#34;file&#34; to indicate that the attachment is a file. ///&#10; attachments:id: The EWS identifier of the item to attach. 100 character limit. ///&#10; attachments:file: The file name of the file to attach. 255 character limit. ///&#10; attachments:url: The URL of the location where the file bytes are located. 2048 character limit. ///&#10; -or- ///&#10; The HTML contents of the email reply. 32 KB limit.</param> } } } }); obj.getEntities = function () { ///<summary>Gets an array of entities found in an item.</summary> return (new Office._context_mailbox_item_entities()); }; obj.getEntitiesByType = function (entityType) { ///<summary>Gets an array of entities of the specified entity type found in an item.</summary> ///<param name="entityType" type="Office.MailboxEnums.EntityType">One of the EntityType enumeration values.</param> if (entityType == Office.MailboxEnums.EntityType.Address) { return (new Array("")); } if (entityType == Office.MailboxEnums.EntityType.Contact) { return (new Array(new Office._context_mailbox_item_contact())); } if (entityType == Office.MailboxEnums.EntityType.EmailAddress) { return (new Array("")); } if (entityType == Office.MailboxEnums.EntityType.MeetingSuggestion) { return (new Array(new Office._context_mailbox_item_meetingSuggestion())); } if (entityType == Office.MailboxEnums.EntityType.PhoneNumber) { return (new Array(new Office._context_mailbox_item_phoneNumber())); } if (entityType == Office.MailboxEnums.EntityType.TaskSuggestion) { return (new Array(new Office._context_mailbox_item_taskSuggestion())); } if (entityType == Office.MailboxEnums.EntityType.Url) { return (new Array("")); } }; obj.getFilteredEntitiesByName = function (name) { ///<summary>Returns well-known enitities that pass the named filter defined in the manifest XML file.</summary> ///<param name="name" type="String">The name of the filter defined in the manifest XML file.</param> return (new Array(Office._context_mailbox_item_entities())); }; obj.getRegExMatches = function () { ///<summary>Returns string values that match the regular expressions defined in the manifest XML file.</summary> return (new Array("")); }; obj.getRegExMatchesByName = function (name) { ///<summary>Returns string values that match the named regular expression defined in the manifest XML file.</summary> ///<param name="name" type="String">The name of the regular expression defined in the manifest XML file.</param> return (new Array("")); }; } obj.loadCustomPropertiesAsync = function (callback, userContext) { ///<summary>Asynchronously loads custom properties that are specific to the item and a mail app for Outlook.</summary> ///<param name="callback" type="Function">The method to call when the asynchronous load is complete.</param> ///<param name="userContext" type="Object" optional="true">Any state data that is passed to the asynchronous method.</param> var result = new Office._Mailbox_AsyncResult("loadCustomPropertiesAsync"); callback(result); }; }; Office._$MailboxAppointment_helper = function (obj, appMode) { // End property. endDoc = { end_compose: { conditions: { hosts: ["not outlook; outlookcompose"] }, name: "end", annotate: { /// <field name="end" type='Time'>Provides methods to get and set the end time of an appointment.</field> end: undefined }, contents: function () { return new Office._context_mailbox_item_time(); } }, end_read: { conditions: { hosts: ["outlook; not outlookcompose"] }, name: "end", annotate: { ///<field name="end" type='Date'>Gets the date and time that the appointment is to end.</field> end: undefined }, contents: function () { return new Date(); } }, end_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "end", annotate: { /// <field name="end">Gets the date and time that the appointment is to end. In read mode, returns Date object. In compose mode, returns a Time object.</field> end: undefined } } } // Location property. locationDoc = { location_compose: { conditions: { hosts: ["not outlook, outlookcompose"] }, name: "location", annotate: { /// <field name="location" type='Location'>Provides methods to get and set the location of an appointment.</field> location: undefined }, contents: function () { return new Office._context_mailbox_item_location() } }, location_read: { conditions: { hosts: ["not outlook, outlookcompose"] }, name: "location", annotate: { ///<field name="location" type='String'>Gets the location of an appointment.</field> location: undefined } }, location_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "location", annotate: { /// <field name="location"> Gets the location of an appointment. In read mode, returns a string. In compose mode returns a Location object.</field> location: undefined } } } // Optional attendees property. optionalAttendeesDoc = { optionalAttendees_compose: { conditions: { hosts: ["not outlook; outlookcompose"] }, name: "optionalAttendees", annotate: { /// <field name="optionalAttendees" type='Recipients'>Provides methods to get and set the optional attendees of an appointment.</field> optionalAttendees: undefined }, contents: function () { return new Office._context_mailbox_item_recipients(); } }, optionalAttendees_read: { conditions: { hosts: ["outlook; not outlookcompose"] }, name: "optionalAttendees", annotate: { ///<field name="optionalAttendees" type='EmailAddressDetails[]'>Gets a list of email addresses for optional attendees of an appointment.</field> optionalAttendees: undefined }, contents: function () { return new Array(new Office._context_mailbox_item_emailAddressDetails()) } }, optionalAttendees_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "optionalAttendees", annotate: { /// <field name="optionalAttendees">Gets a list of email addresses for optional attendees of an appointment. In read mode, returns an array of EmailAddressDetails objects. In compose mode, returns a Recipients object.</field> optionalAttendees: undefined } } } // Organizer property. organizerDoc = { organizer_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "organizer", annotate: { ///<field name="organizer" type="EmailAddressDetails">Gets the email address of the meeting organizer for the specified meeting.</field> organizer: undefined }, contents: function () { return new Office._context_mailbox_item_emailAddressDetails() } }, organizer_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "organizer", annotate: { ///<field name="organizer" type="EmailAddressDetails">Gets the email address of the meeting organizer for the specified meeting. In compose mode, the organizer property is undefined.</field> organizer: undefined }, contents: function () { return new Office._context_mailbox_item_emailAddressDetails() } } } // Required attendees requiredAttendeesDoc = { requiredAttendees_compose: { conditions: { hosts: ["not outlook, outlookcompose"] }, name: "requiredAttendees", annotate: { /// <field name="requiredAttendees" type='Recipients'>Provides methods to get and set the required attendees of an appointment.</field> requiredAttendees: undefined }, contents: function () { return new Office._context_mailbox_item_recipients(); } }, requiredAttendees_read: { conditions: { hosts: ["outlook; not outlookcompose"] }, name: "requiredAttendees", annotate: { /// <field name="requiredAttendees" type='EmailAddressDetails[]'>Gets a list of email addresses for required attendees of an appointment.</field> requiredAttendees: undefined }, contents: function () { return new Array(new Office._context_mailbox_item_emailAddressDetails()) } }, requiredAttendees_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "requiredAttendees", annotate: { /// <field name="optionalAttendees">Gets a list of email addresses for required attendees of an appointment. In read mode, returns an array of EmailAddressDetails objects. In compose mode, returns a Recipients object.</field> requiredAttendees: undefined } } } // Resources property. resourcesDoc = { resources_read: { conditions: { hosts: ["outlook; not outlookcompose"] }, name: "resources", annotate: { /// <field name="resources" type='EmailAddressDetails[]'>Gets the resources required for an appointment.</field> resources: undefined }, contents: function () { return new Array(new Office._context_mailbox_item_emailAddressDetails()) } }, resources_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "resources", annotate: { /// <field name="resources">Gets the resources required for an appointment. In read mode, returns an array of EmailAddressDetails objects. In compose mode, the resources property is undefined.</field> resources: undefined } } } // Start property startDoc = { start_compose: { conditions: { hosts: ["not outlook; outlookcompose"] }, name: "start", annotate: { /// <field name="start" type='Time'>Provides methods to get and set the start time for the appointment.</field> start: undefined }, contents: function () { return new Office._context_mailbox_item_time(); } }, start_read: { conditions: { hosts: ["outlook; not outlookcompose"] }, name: "start", annotate: { ///<field name="start" type='Date'>Gets the date and time that the appointment is to begin.</field> start: undefined }, contents: function () { return new Date(); } }, start_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "start", annotate: { /// <field name="start">Gets the date and time that the appointment is to begin. In read mode, returns Date object. In compose mode, returns a Time object.</field> start: undefined } } } if (appMode == Office._appMode.Compose) { delete endDoc.end_compose["conditions"]; delete endDoc["end_read"]; delete endDoc["end_read_compose"]; delete locationDoc.location_compose["conditions"]; delete locationDoc["location_read"]; delete locationDoc["location_read_compose"]; delete optionalAttendeesDoc.optionalAttendees_compose["conditions"]; delete optionalAttendeesDoc["optionalAttendees_read"]; delete optionalAttendeesDoc["optionalAttendees_read_compose"]; delete organizerDoc["organizer_read"]; delete organizerDoc["organizer_read_compose"]; delete requiredAttendeesDoc.requiredAttendees_compose["conditions"]; delete requiredAttendeesDoc["requiredAttendees_read"]; delete requiredAttendeesDoc["requiredAttendees_read_compose"]; delete resourcesDoc["resources_read"]; delete resourcesDoc["resources_read_compose"]; delete startDoc.start_compose["conditions"]; delete startDoc["start_read"]; delete startDoc["start_read_compose"]; } else if (appMode == Office._appMode.Read) { delete endDoc["end_compose"]; delete endDoc.end_read["conditions"]; delete endDoc["end_read_compose"]; delete locationDoc["location_compose"]; delete locationDoc.location_read["conditions"]; delete locationDoc["location_read_compose"]; delete optionalAttendeesDoc["optionalAttendees_compose"]; delete optionalAttendeesDoc.optionalAttendees_read["conditions"]; delete optionalAttendeesDoc["optionalAttendees_read_compose"]; delete organizerDoc.organizer_read["conditions"]; delete organizerDoc["organizer_read_compose"]; delete requiredAttendeesDoc["requiredAttendees_compose"]; delete requiredAttendeesDoc.requiredAttendees_read["conditions"]; delete requiredAttendeesDoc["requiredAttendees_read_compose"]; delete resourcesDoc.resources_read["conditions"]; delete resourcesDoc["resources_read_compose"]; delete startDoc["start_compose"]; delete startDoc.start_read["conditions"]; delete startDoc["start_read_compose"]; } else if (appMode == Office._appMode.ReadCompose) { delete endDoc["end_compose"]; delete endDoc["end_read"]; delete endDoc.end_read_compose["condtions"]; delete locationDoc["location_compose"]; delete locationDoc["location_read"]; delete optionalAttendeesDoc["optionalAttendees_compose"]; delete optionalAttendeesDoc["optionalAttendees_read"]; delete optionalAttendeesDoc.optionalAttendees_read_compose["conditions"]; delete locationDoc.location_read_compose["conditions"]; delete organizerDoc["organizer_read"]; delete organizerDoc.organizer_read_compose["conditions"]; delete requiredAttendeesDoc["requiredAttendees_compose"]; delete requiredAttendeesDoc["requiredAttendees_read"]; delete requiredAttendeesDoc.requiredAttendees_read_compose["conditions"]; delete resourcesDoc["resources_read"]; delete resourcesDoc.resources_read_compose["conditions"]; delete startDoc["start_compose"]; delete startDoc["start_read"]; delete startDoc.start_read_compose["conditions"]; } Office._processContents(obj, endDoc); Office._processContents(obj, locationDoc); Office._processContents(obj, optionalAttendeesDoc); Office._processContents(obj, organizerDoc); Office._processContents(obj, requiredAttendeesDoc); Office._processContents(obj, resourcesDoc); Office._processContents(obj, startDoc); }; Office._$MailboxMessage_helper = function (obj, appMode) { // BCC property. bccDoc = { bcc_compose: { conditions: { hosts: ["not outlook; outlookcompose"] }, name: "bcc", annotate: { /// <field name="bcc" type='Recipients'>Provides methods to get and set the Bcc recipients of a message.</field> bcc: undefined }, contents: function () { return new Office._context_mailbox_item_recipients(); } }, bcc_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "bcc", annotate: { /// <field name="bcc">Gets the Bcc recipients of a message. In read mode, the bcc property is undefined. In compose mode it returns a Recipients object.</field> bcc: undefined } } } // CC property. ccDoc = { cc_compose: { conditions: { hosts: ["not outlook; outlookcompose"] }, name: "cc", annotate: { /// <field name="cc" type='Recipients'>Provides methods to get and set the carbon-copy (Cc) recipients of a message.</field> cc: undefined }, contents: function () { return new Office._context_mailbox_item_recipients(); } }, cc_read: { conditions: { hosts: ["outlook; not outlookcompose"] }, name: "cc", annotate: { /// <field name="cc" type='String'>Gets the carbon-copy (Cc) recipients of a message.</field> cc: undefined }, contents: function () { return new Array(new Office._context_mailbox_item_emailAddressDetails()) } }, cc_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "cc", annotate: { /// <field name="cc"> Gets the carbon-copy (Cc) recipients of a message. In read mode, the cc property returns an array of EmailAddressDetails objects. In compose mode it returns a Recipients object.</field> cc: undefined } } } // conversationId property Office._processContents(obj, { conversationIdDoc: { conditions: { hosts: ["outlook", "outlookcompose"] }, name: "conversationId", annotate: { ///<field name="conversationId" type='String'>Gets an identifier for the email conversation that contains a particular message.</field> conversationId: undefined } } }); // From property. fromDoc = { from_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "from", annotate: { /// <field name="from" type='EmailAddressDetails'>Gets the email address of the message's sender.</field> from: undefined }, contents: function () { return new Office._context_mailbox_item_emailAddressDetails(); } }, from_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "from", annotate: { /// <field name="from" type='EmailAddressDetails'>Gets the email address of the message's sender. In compose mode, the from property is undefined.</field> from: undefined }, contents: function () { return new Office._context_mailbox_item_emailAddressDetails(); } } } // InternetMessageId property. internetMessageIdDoc = { internetMessageId_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "internetMessageId", annotate: { /// <field name="internetMessageId" type='String'>Gets the internet message identifier of the message.</field> internetMessageId: undefined } }, internetMessageId_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "internetMessageId", annotate: { /// <field name="internetMessageId" type='String'>Gets the internet message identifier of the message. In compose mode, the internetMessageId property is undefined.</field> internetMessageId: undefined } } } // Sender property. senderDoc = { sender_read: { conditions: { hosts: ["outlook, not outlookcompose"] }, name: "sender", annotate: { /// <field name="sender" type='EmailAddressDetails'>Gets the email address of the message sender.</field> sender: undefined }, contents: function () { return new Office._context_mailbox_item_emailAddressDetails(); } }, sender_read_compose: { conditions: { hosts: ["outlook, outlookcompose"] }, name: "sender", annotate: { /// <field name="sender" type='EmailAddressDetails'>Gets the email address of the message sender. In compose mode, the sender property is undefined.</field> sender: undefined }, contents: function () { return new Office._context_mailbox_item_emailAddressDetails(); } } } // To property toDoc = { to_compose: { conditions: { hosts: ["not outlook; outlookcompose"] }, name: "to", annotate: { /// <field name="to" type='Recipients'>Provides methods to get and set the list of recipients of a message.</field> to: undefined }, contents: function () { return new Office._context_mailbox_item_recipients(); } }, to_read: { conditions: { hosts: ["outlook; not outlookcompose"] }, name: "to", annotate: { /// <field name="to" type='EmailAddressDetails[]'>Gets the list of recipients of a message.</field> to: undefined }, contents: function () { return new Array(new Office._context_mailbox_item_emailAddressDetails()) } }, to_read_compose: { conditions: { hosts: ["outlook; outlookcompose"] }, name: "to", annotate: { /// <field name="to">Gets the list of recipients of a message. In read mode, the to property returns an array of EmailAddressDetails objects. In compose mode, it returns a Recipients object.</field> to: undefined } } } if (appMode == Office._appMode.Compose) { delete bccDoc.bcc_compose["conditions"]; delete bccDoc["bcc_read_compose"]; delete ccDoc.cc_compose["conditions"]; delete ccDoc["cc_read"]; delete ccDoc["cc_read_compose"]; delete fromDoc["from_read"]; delete fromDoc["from_read_compose"]; delete internetMessageIdDoc["internetMessageId_read"]; delete internetMessageIdDoc["internetMessageId_read_compose"]; delete senderDoc["sender_read"]; delete senderDoc["sender_read_compose"]; delete toDoc.to_compose["conditions"]; delete toDoc["to_read"]; delete toDoc["to_read_compose"]; } else if (appMode == Office._appMode.Read) { delete bccDoc["bcc_compose"]; delete bccDoc["bcc_read_compose"]; delete ccDoc["cc_compose"]; delete ccDoc.cc_read["conditions"]; delete ccDoc["cc_read_compose"]; delete fromDoc.from_read["conditions"]; delete fromDoc["from_read_compose"]; delete internetMessageIdDoc.internetMessageId_read["conditions"]; delete internetMessageIdDoc["internetMessageId_read_compose"]; delete senderDoc.sender_read["conditions"]; delete senderDoc["sender_read_compose"]; delete toDoc["to_compose"]; delete toDoc.to_read["conditions"]; delete toDoc["to_read_compose"]; } else if (appMode == Office._appMode.ReadCompose) { delete bccDoc["bcc_compose"]; delete bccDoc.bcc_read_compose["conditions"]; delete ccDoc["cc_compose"]; delete ccDoc["cc_read"]; delete ccDoc.cc_read_compose["conditions"]; delete fromDoc["from_read"]; delete fromDoc.from_read_compose["conditions"]; delete internetMessageIdDoc["internetMessageId_read"]; delete internetMessageIdDoc.internetMessageId_read_compose["conditions"]; delete senderDoc["sender_read"]; delete senderDoc.sender_read_compose["conditions"]; delete toDoc["to_compose"]; delete toDoc["to_read"]; delete toDoc.to_read_compose["conditions"]; } Office._processContents(obj, bccDoc); Office._processContents(obj, ccDoc); Office._processContents(obj, fromDoc); Office._processContents(obj, internetMessageIdDoc); Office._processContents(obj, senderDoc); Office._processContents(obj, toDoc); } Office._context_mailbox = function () { ///<field name="ewsUrl" type='String'>Gets the URL of the Exchange Web Services (EWS) endpoint for this email account.</field> ///<field name="item" type="Item">Represents the current item (message or appointment).</field> ///<field name="userProfile" type="UserProfile">Represents the host application's user profile information.</field> ///<field name="diagnostics" type="Diagnostics">Provides troubleshooting capabilities for a mail app.</field> var instance = new Office._context_mailbox_item(); this.ewsUrl = {}; this.item = intellisense.nullWithCompletionsOf(instance); this.userProfile = new Office._context_mailbox_userProfile(); this.diagnostics = new Office._context_mailbox_diagnostics(); this.displayAppointmentForm = function (itemId) { ///<summary>Displays