Office.AppointmentRead interface  
Office.context.mailbox.item 的约会与会者模式。
              重要说明:这是一个内部 Outlook 对象,不会通过现有接口直接公开。 应将其视为 的 Office.context.mailbox.item模式。 有关详细信息,请参阅 “对象模型 ”页。
父接口:
属性
| attachments | 获取项的附件作为数组。 | 
| body | 获取一个提供用于处理项目正文的方法的对象。 | 
| categories | 获取一个 对象,该对象提供用于管理项类别的方法。 | 
| date | 获取项目创建的日期和时间。 | 
| date | 获取项目最近一次修改的日期和时间。 | 
| end | 获取约会结束的日期和时间。 属性  使用  | 
| enhanced | 获取约会的位置。 属性  | 
| item | 获取所选约会的 Exchange Web Services 项类。 
               | 
| item | |
| item | 获取实例表示的项的类型。 属性  | 
| location | 获取约会的位置。 
               | 
| normalized | 获取项目的主题,删除所有前缀 (包括 RE: 和 FWD:) 。 属性  | 
| notification | 获取项目的通知邮件。 | 
| optional | 提供对事件的可选与会者的访问权限。 对象的类型和访问级别取决于当前项的模式。 属性  
 | 
| organizer | 获取会议组织者的电子邮件属性。 | 
| recurrence | 获取约会的重复模式。 获取会议请求的重复模式。 如果项目是系列或系列中的实例,则  
              注意:会议请求  注意:如果定期对象为 null,则表示该对象是单个约会或单个约会的会议请求,而不是序列的一部分。 | 
| required | 提供对事件的必需与会者的访问权限。 对象的类型和访问级别取决于当前项的模式。 属性  
 | 
| series | 获取实例所属的序列的 ID。 在 Outlook 网页版 中,在 Windows (新) 和经典) ,在 Mac 上, 
              注意:属性返回的  对于没有父项(如单个约会、系列项目或会议请求)的项目,属性 | 
| start | 获取约会开始的日期和时间。 属性  | 
| subject | 获取在项的主题字段中显示的说明。 
               
               | 
方法
| add | 添加支持事件的事件处理程序。 注意:事件仅适用于任务窗格实现。 有关支持的事件,请参阅 Item 对象模型 事件部分。 | 
| add | 添加支持事件的事件处理程序。 注意:事件仅适用于任务窗格实现。 有关支持的事件,请参阅 Item 对象模型 事件部分。 | 
| display | 显示一个答复表单,其中包括所选邮件的发件人和所有收件人或组织者以及所选约会的所有与会者。 | 
| display | 显示一个答复表单,其中包括所选邮件的发件人和所有收件人或组织者以及所选约会的所有与会者。 在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。 如果任意字符串参数超出其限制, 在 参数中  注意:iOS 版或 Android 版 Outlook 不支持此方法。 | 
| display | 显示一个答复表单,其中包括所选邮件的发件人和所有收件人或组织者以及所选约会的所有与会者。 在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。 如果任意字符串参数超出其限制, 在 参数中  注意:iOS 版或 Android 版 Outlook 不支持此方法。 | 
| display | 显示答复窗体,其中仅包括所选邮件的发件人或所选约会的组织者。 | 
| display | 显示答复窗体,其中仅包括所选邮件的发件人或所选约会的组织者。 在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。 如果任意字符串参数超出其限制, 在 参数中  注意:iOS 版或 Android 版 Outlook 不支持此方法。 | 
| display | 显示答复窗体,其中仅包括所选邮件的发件人或所选约会的组织者。 在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。 如果任意字符串参数超出其限制, 在 参数中  注意:iOS 版或 Android 版 Outlook 不支持此方法。 | 
| get | 从邮件或约会中获取附件,并将其作为  | 
| get | 从邮件或约会中获取附件,并将其作为  | 
| get | 获取在所选项目的正文中找到的实体。 警告:基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。 | 
| get | 获取所选项目的正文中找到的指定实体类型的所有实体的数组。 警告:基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。 | 
| get | 返回所选项中的已知实体,这些实体通过仅外接程序清单文件中定义的命名筛选器。 警告:基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。 | 
| get | 获取当 加载项被可作消息激活时传递的初始化数据。 | 
| get | 获取当 加载项被可作消息激活时传递的初始化数据。 | 
| get | 返回所选项中与仅外接程序清单文件中定义的正则表达式匹配的字符串值。 | 
| get | 返回所选项中与仅外接程序清单文件中定义的命名正则表达式匹配的字符串值。 | 
| get | 获取在用户已选择的突出显示匹配项中找到的实体。 突出显示的匹配项适用于上下文外接程序。 警告:基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。 | 
| get | 返回突出显示的匹配项中的字符串值,该值与仅外接程序清单文件中定义的正则表达式匹配。 突出显示的匹配项适用于上下文外接程序。 | 
| get | 获取共享文件夹或共享邮箱中约会或邮件的属性。 有关使用此 API 的详细信息,请参阅 在 Outlook 外接程序中启用共享文件夹和共享邮箱方案。 | 
| get | 获取共享文件夹或共享邮箱中约会或邮件的属性。 有关使用此 API 的详细信息,请参阅 在 Outlook 外接程序中启用共享文件夹和共享邮箱方案。 | 
| load | 异步加载所选项目上此外接程序的自定义属性。 自定义属性以键值对的形式存储在每个应用、每个项目的基础上。 此方法在回调中返回 CustomProperties 对象,该对象提供访问特定于当前项和当前加载项的自定义属性的方法。 自定义属性不会对项进行加密,因此不应将其用作安全存储。 自定义属性作为  | 
| remove | 删除受支持事件类型的事件处理程序。 注意:事件仅适用于任务窗格实现。 有关支持的事件,请参阅 Item 对象模型 事件部分。 | 
| remove | 删除受支持事件类型的事件处理程序。 注意:事件仅适用于任务窗格实现。 有关支持的事件,请参阅 Item 对象模型 事件部分。 | 
属性详细信息
attachments
获取项的附件作为数组。
attachments: AttachmentDetails[];属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 由于潜在的安全问题,某些类型的文件会受到 Outlook 阻止,并且不会返回。 有关详细信息,请参阅 Outlook 中阻止的附件。 
- 不会返回使用 “上传和共享 ”选项添加的附件。 
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/40-attachments/get-attachments-read.yaml
const item = Office.context.mailbox.item;
if (item.attachments.length > 0) {
    for (let i = 0; i < item.attachments.length; i++) {
        const attachment = item.attachments[i];
        console.log(`${i+1}. Name: ${attachment.name}`);
        console.log(`ID: ${attachment.id}`);
        console.log(`Type: ${attachment.attachmentType}`);
        console.log(`Inline content: ${attachment.isInline}`);
        console.log(`Size: ${attachment.size}`);
    }
} else {
    console.log("This mail item doesn't contain any attachments.");
}
body
获取一个提供用于处理项目正文的方法的对象。
body: Body;属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// This example gets the body of the item as plain text.
Office.context.mailbox.item.body.getAsync(
    Office.CoercionType.Text,
    { asyncContext: "This is passed to the callback" },
    (result) => {
        // Do something with the result.
    }
);
// The following is an example of the result parameter passed to the callback function.
{
    "value": "TEXT of whole body (including message threads that appear below the current body)",
    "status": "succeeded",
    "asyncContext": "This is passed to the callback"
}
categories
获取一个 对象,该对象提供用于管理项类别的方法。
categories: Categories;属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/45-categories/work-with-categories.yaml
Office.context.mailbox.item.categories.getAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    const categories = asyncResult.value;
    if (categories && categories.length > 0) {
      console.log("Categories assigned to this item:");
      console.log(JSON.stringify(categories));
    } else {
      console.log("There are no categories assigned to this item.");
    }
  } else {
    console.error(asyncResult.error);
  }
});
...
// Note: In order for you to successfully add a category,
// it must be in the mailbox categories master list.
Office.context.mailbox.masterCategories.getAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    const masterCategories = asyncResult.value;
    if (masterCategories && masterCategories.length > 0) {
      // Grab the first category from the master list.
      const categoryToAdd = [masterCategories[0].displayName];
      Office.context.mailbox.item.categories.addAsync(categoryToAdd, function(asyncResult) {
        if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
          console.log(`Successfully assigned category '${categoryToAdd}' to item.`);
        } else {
          console.log("categories.addAsync call failed with error: " + asyncResult.error.message);
        }
      });
    } else {
      console.log("There are no categories in the master list on this mailbox. You can add categories using Office.context.mailbox.masterCategories.addAsync.");
    }
  } else {
    console.error(asyncResult.error);
  }
});
...
Office.context.mailbox.item.categories.getAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    const categories = asyncResult.value;
    if (categories && categories.length > 0) {
      // Grab the first category assigned to this item.
      const categoryToRemove = [categories[0].displayName];
      Office.context.mailbox.item.categories.removeAsync(categoryToRemove, function(asyncResult) {
        if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
          console.log(`Successfully unassigned category '${categoryToRemove}' from this item.`);
        } else {
          console.log("categories.removeAsync call failed with error: " + asyncResult.error.message);
        }
      });
    } else {
      console.log("There are no categories assigned to this item.");
    }
  } else {
    console.error(asyncResult.error);
  }
});
		dateTimeCreated
	  
	获取项目创建的日期和时间。
dateTimeCreated: Date;属性值
Date
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-date-time-created-read.yaml
console.log(`Creation date and time: ${Office.context.mailbox.item.dateTimeCreated}`);
		dateTimeModified
	  
	获取项目最近一次修改的日期和时间。
dateTimeModified: Date;属性值
Date
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要提示:Android 版或 iOS 版 Outlook 不支持此属性。 有关 Outlook mobile 中支持的 API 的详细信息,请参阅移动设备上的 Outlook 中支持的 Outlook JavaScript API。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-date-time-modified-read.yaml
console.log(`Date and time item last modified: ${Office.context.mailbox.item.dateTimeModified}`);
end
获取约会结束的日期和时间。
属性 end 是表示 Date 为协调世界时 (UTC) 日期和时间值的对象。 可以使用 convertToLocalClientTime 方法将 end 属性值转换为客户端的本地日期和时间。
使用 Time.setAsync 方法设置结束时间时,应使用 convertToUtcClientTime 方法将客户端的本地时间转换为服务器的 UTC。
end: Date;属性值
Date
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-end-read.yaml
const time = Office.context.mailbox.item.end;
const localTime = Office.context.mailbox.convertToLocalClientTime(time);
console.log(`Appointment ends (local): ${localTime.month + 1}/${localTime.date}/${localTime.year}, ${localTime.hours}:${localTime.minutes}:${localTime.seconds}`);
		enhancedLocation
	 
	获取约会的位置。
属性 enhancedLocation 返回一个 EnhancedLocation 对象,该对象允许您获取位置集 (每个位置由与约会关联的 LocationDetails 对象) 表示。
enhancedLocation: EnhancedLocation;属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
              重要提示:若要在不支持邮箱要求集 1.8 的 Outlook 客户端中管理约会的位置,请改用 location 属性。 有关为方案选择正确位置 API 的指导,请参阅在 Outlook 中撰写任命时获取或设置位置。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-add-remove-enhancedlocation-appointment.yaml
Office.context.mailbox.item.enhancedLocation.getAsync((result) => {
  if (result.status !== Office.AsyncResultStatus.Succeeded) {
    console.error(`Failed to get locations. Error message: ${result.error.message}`);
    return;
  }
  const places = result.value;
  if (places && places.length > 0) {
    result.value.forEach(function(place) {
      console.log(`Location: ${place.displayName} (type: ${place.locationIdentifier.type})`);
      if (place.locationIdentifier.type === Office.MailboxEnums.LocationType.Room) {
        console.log("Email address: " + place.emailAddress);
      }
    });
  } else {
    console.log("There are no locations.");
  }
});
		itemClass
	 
	获取所选约会的 Exchange Web Services 项类。
              IPM.Appointment非定期约会和IPM.Appointment.Occurrence定期约会的返回值。
itemClass: string;属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
              重要说明:可以创建自定义类来扩展默认项类。 例如, IPM.Appointment.Contoso。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-item-class-read.yaml
console.log(`Item class: ${Office.context.mailbox.item.itemClass}`);
		itemId
	 
	获取 当前项目的 Exchange Web Services (EWS) 项标识符 。
itemId: string;属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 属性 - itemId在撰写模式下不可用。 如果需要项目标识符,- Office.context.mailbox.item.saveAsync方法可用于将项目保存到存储,这将在回调函数的- asyncResult.value参数中返回项目标识符。 如果项已保存,可以改为调用- Office.context.mailbox.item.getItemIdAsync方法。
- 返回的项目 ID 与 Outlook 条目 ID 或 Outlook REST API 使用的 ID 不同。 在使用此值进行 REST API 调用之前,应使用 - Office.context.mailbox.convertToRestId进行转换。
示例
// The following code checks for the presence of an item
// identifier. If the `itemId` property returns `null` or
// `undefined`, it saves the item to the store and gets the
// item identifier from the asynchronous result.
// **Important**: `saveAsync` was introduced with requirement set 1.3
// so you can't get the `itemId` in Compose mode in earlier sets.
let itemId = Office.context.mailbox.item.itemId;
if (itemId === null || itemId == undefined) {
    Office.context.mailbox.item.saveAsync(function(result) {
        itemId = result.value;
    });
}
		itemType
	 
	获取实例表示的项的类型。
属性 itemType 返回枚举值之 ItemType 一,指示项目对象实例是消息还是约会。
itemType: MailboxEnums.ItemType | string;属性值
Office.MailboxEnums.ItemType | string
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-item-type.yaml
const itemType = Office.context.mailbox.item.itemType;
switch (itemType) {
    case Office.MailboxEnums.ItemType.Appointment:
        console.log(`Current item is an ${itemType}.`);
        break;
    case Office.MailboxEnums.ItemType.Message:
        console.log(`Current item is a ${itemType}. A message could be an email, meeting request, meeting response, or meeting cancellation.`);
        break;
}
location
获取约会的位置。
              location 属性返回一个包含约会位置的字符串。
location: string;属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
              重要说明:属性 enhancedLocation 是在邮箱要求集 1.8 中引入的。 
              enhancedLocation使用 属性可以更好地标识和管理约会位置,尤其是在需要确定位置类型时。 有关为方案选择正确位置 API 的指导,请参阅在 Outlook 中撰写任命时获取或设置位置。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-location-read.yaml
console.log(`Appointment location: ${Office.context.mailbox.item.location}`);
		normalizedSubject
	 
	获取项目的主题,删除所有前缀 (包括 RE: 和 FWD:) 。
属性 normalizedSubject 获取项目的主题,其中包含电子邮件程序添加的任何标准前缀 (如 RE: 和 FW:) 。 若要获取包含完整前缀的项目主题,请使用 subject 属性。
normalizedSubject: string;属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-normalized-subject-read.yaml
console.log(`Normalized subject: ${Office.context.mailbox.item.normalizedSubject}`);
		notificationMessages
	 
	获取项目的通知邮件。
notificationMessages: NotificationMessages;属性值
注解
[ API 集:邮箱 1.3 ]
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 若要了解可实现的不同类型的通知消息,请参阅 为 Outlook 加载项创建通知。 
- Android 版或 iOS 版 Outlook 不支持此属性。 有关 Outlook mobile 中支持的 API 的详细信息,请参阅移动设备上的 Outlook 中支持的 Outlook JavaScript API。 
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/35-notifications/add-getall-remove.yaml
// Adds a progress indicator to the mail item.
const id = (document.getElementById("notificationId") as HTMLInputElement).value;
const details =
  {
    type: Office.MailboxEnums.ItemNotificationMessageType.ProgressIndicator,
    message: "Progress indicator with id = " + id
  };
Office.context.mailbox.item.notificationMessages.addAsync(id, details, handleResult);
...
// Adds an informational notification to the mail item.
const id = (document.getElementById("notificationId") as HTMLInputElement).value;
const details =
  {
    type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
    message: "Non-persistent informational notification message with id = " + id,
    icon: "PG.Icon.16",
    persistent: false
  };
Office.context.mailbox.item.notificationMessages.addAsync(id, details, handleResult);
...
// Adds a persistent information notification to the mail item.
const id = (document.getElementById("notificationId") as HTMLInputElement).value;
const details =
  {
    type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
    message: "Persistent informational notification message with id = " + id,
    icon: "PG.Icon.16",
    persistent: true
  };
Office.context.mailbox.item.notificationMessages.addAsync(id, details, handleResult);
...
// Gets all the notification messages and their keys for the current mail item.
Office.context.mailbox.item.notificationMessages.getAllAsync((asyncResult) => {
  if (asyncResult.status === Office.AsyncResultStatus.Failed) {
    console.log(asyncResult.error.message);
    return;
  }
  console.log(asyncResult.value);
});
...
// Replaces a notification message of a given key with another message.
const id = (document.getElementById("notificationId") as HTMLInputElement).value;
Office.context.mailbox.item.notificationMessages.replaceAsync(
  id,
  {
    type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
    message: "Notification message with id = " + id + " has been replaced with an informational message.",
    icon: "icon2",
    persistent: false
  },
  handleResult);
...
// Removes a notification message from the current mail item.
const id = (document.getElementById("notificationId") as HTMLInputElement).value;
Office.context.mailbox.item.notificationMessages.removeAsync(id, handleResult);
		optionalAttendees
	 
	提供对事件的可选与会者的访问权限。 对象的类型和访问级别取决于当前项的模式。
属性 optionalAttendees 返回一个数组,其中包含每个参加会议的可选与会者的 EmailAddressDetails 对象。 返回的最大与会者数因 Outlook 客户端而异。
- Windows:500 名与会者 
- Android、经典 Mac UI、iOS:100 名与会者 
- 新 Mac UI、Web 浏览器:无限制 
optionalAttendees: EmailAddressDetails[];属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/30-recipients-and-attendees/get-optional-attendees-appointment-attendee.yaml
const apptOptionalAttendees = Office.context.mailbox.item.optionalAttendees;
console.log("Optional attendees:");
for (let i = 0; i < apptOptionalAttendees.length; i++) {
  console.log(
    apptOptionalAttendees[i].displayName +
      " (" +
      apptOptionalAttendees[i].emailAddress +
      ") - response: " +
      apptOptionalAttendees[i].appointmentResponse
  );
}
organizer
获取会议组织者的电子邮件属性。
organizer: EmailAddressDetails;属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/30-recipients-and-attendees/get-organizer-appointment-attendee.yaml
const apptOrganizer = Office.context.mailbox.item.organizer;
console.log("Organizer: " + apptOrganizer.displayName + " (" + apptOrganizer.emailAddress + ")");
recurrence
获取约会的重复模式。 获取会议请求的重复模式。
如果项目是系列或系列中的实例,则 recurrence 属性返回定期约会或会议请求的 Recurrence 对象。 
              null 返回单个约会和单个约会的会议请求。
              注意:会议请求 itemClass 的 IPM.Schedule.Meeting.Request值为 。
注意:如果定期对象为 null,则表示该对象是单个约会或单个约会的会议请求,而不是序列的一部分。
recurrence: Recurrence;属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/50-recurrence/get-recurrence-read.yaml
const recurrence = Office.context.mailbox.item.recurrence;
if (recurrence === undefined) {
  console.log("This item is a message but not a meeting request.");
} else if (recurrence === null) {
  console.log("This is a single appointment.");
} else {
  console.log(JSON.stringify(recurrence));
}
		requiredAttendees
	 
	提供对事件的必需与会者的访问权限。 对象的类型和访问级别取决于当前项的模式。
属性 requiredAttendees 返回一个数组,其中包含参加会议的每个所需与会者的 EmailAddressDetails 对象。 返回的最大与会者数因 Outlook 客户端而异。
- Windows:500 名与会者 
- Android、经典 Mac UI、iOS:100 名与会者 
- 新 Mac UI、Web 浏览器:无限制 
requiredAttendees: EmailAddressDetails[];属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
              重要提示:在 Outlook 网页版 和 Windows (新的和经典) 中,约会组织者包含在 属性返回的 requiredAttendees 对象中。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/30-recipients-and-attendees/get-required-attendees-appointment-attendee.yaml
const apptRequiredAttendees = Office.context.mailbox.item.requiredAttendees;
console.log("Required attendees:");
for (let i = 0; i < apptRequiredAttendees.length; i++) {
  console.log(
    apptRequiredAttendees[i].displayName +
      " (" +
      apptRequiredAttendees[i].emailAddress +
      ") - response: " +
      apptRequiredAttendees[i].appointmentResponse
  );
}
		seriesId
	 
	获取实例所属的序列的 ID。
在 Outlook 网页版 中,在 Windows (新) 和经典) ,在 Mac 上,seriesId返回此项目所属的父 (系列) 的 Exchange Web Services (EWS) ID。 但是,在 iOS 和 Android 上,seriesId 返回父项的 REST ID。
              注意:属性返回的 seriesId 标识符与 Exchange Web Services 项标识符相同。 属性 seriesId 与 Outlook REST API 使用的 Outlook ID 不同。 在使用此值进行 REST API 调用之前,应使用 Office.context.mailbox.convertToRestId进行转换。 有关详细信息,请参阅 使用 Outlook 外接程序中的 Outlook REST API。
对于没有父项(如单个约会、系列项目或会议请求)的项目,属性seriesIdnull返回 ,对于不是会议请求的任何其他项目,则返回 undefined 。
seriesId: string;属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/50-recurrence/get-series-id.yaml
const seriesId = Office.context.mailbox.item.seriesId;
if (seriesId === undefined) {
  console.log("This is a message that's not a meeting request.");
} else if (seriesId === null) {
  console.log("This is a single appointment, a parent series, or a meeting request for a series or single meeting.");
} else {
  console.log("This is an instance belonging to series with ID " + seriesId);
}
start
获取约会开始的日期和时间。
属性 start 是表示 Date 为协调世界时 (UTC) 日期和时间值的对象。 可以使用 convertToLocalClientTime 方法将值转换为客户端的本地日期和时间。
start: Date;属性值
Date
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-start-read.yaml
const time = Office.context.mailbox.item.start;
const localTime = Office.context.mailbox.convertToLocalClientTime(time);
console.log(`Appointment starts (local): ${localTime.month + 1}/${localTime.date}/${localTime.year}, ${localTime.hours}:${localTime.minutes}:${localTime.seconds}`);
subject
获取在项的主题字段中显示的说明。
              subject 属性获取或设置由电子邮件服务器发送项目时的整个主题。
              subject 属性返回一个字符串。 
              normalizedSubject使用 属性获取主题减去任何前导前缀,例如 RE: 和 FW:。
subject: string;属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-subject-read.yaml
console.log(`Subject: ${Office.context.mailbox.item.subject}`);
方法详细信息
		addHandlerAsync(eventType, handler, options, callback)
	   
	添加支持事件的事件处理程序。 注意:事件仅适用于任务窗格实现。
有关支持的事件,请参阅 Item 对象模型 事件部分。
addHandlerAsync(eventType: Office.EventType | string, handler: any, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- eventType
- 
				Office.EventType | string 
应调用处理程序的事件。
- handler
- 
				any 
用于处理事件的函数。 此函数必须接受一个参数,即对象文本。 参数type上的 属性将与传递给 addHandlerAsync的参数匹配eventType。
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
function myHandlerFunction(eventarg) {
    if (eventarg.attachmentStatus === Office.MailboxEnums.AttachmentStatus.Added) {
        const attachment = eventarg.attachmentDetails;
        console.log("Event Fired and Attachment Added!");
        getAttachmentContentAsync(attachment.id, options, callback);
    }
}
Office.context.mailbox.item.addHandlerAsync(Office.EventType.AttachmentsChanged, myHandlerFunction, myCallback);
		addHandlerAsync(eventType, handler, callback)
	   
	添加支持事件的事件处理程序。 注意:事件仅适用于任务窗格实现。
有关支持的事件,请参阅 Item 对象模型 事件部分。
addHandlerAsync(eventType: Office.EventType | string, handler: any, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- eventType
- 
				Office.EventType | string 
应调用处理程序的事件。
- handler
- 
				any 
用于处理事件的函数。 此函数必须接受一个参数,即对象文本。 参数type上的 属性将与传递给 addHandlerAsync的参数匹配eventType。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
		displayReplyAllForm(formData)
	    
	显示一个答复表单,其中包括所选邮件的发件人和所有收件人或组织者以及所选约会的所有与会者。
displayReplyAllForm(formData: string | ReplyFormData): void;参数
- formData
- 
				string | Office.ReplyFormData 
一个包含文本和 HTML 且表示答复窗体的正文的字符串。 字符串限制为 32 KB 或包含正文或附件数据和回调函数的 ReplyFormData 对象。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 在Outlook 网页版中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。 
- 如果任意字符串参数超出其限制, - displayReplyForm将引发异常。
- 在 参数中 - formData.attachments指定附件时,Outlook 会尝试下载所有附件并将其附加到答复表单。 如果无法添加任何附件,则在窗体 UI 中显示错误。 如果这不可能,则不引发错误消息。
- Android 版或 iOS 版 Outlook 不支持此方法。 有关 Outlook mobile 中支持的 API 的详细信息,请参阅移动设备上的 Outlook 中支持的 Outlook JavaScript API。 
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/55-display-items/display-reply-forms.yaml
Office.context.mailbox.item.displayReplyAllForm("This is a reply ALL with <b>some bold text</b>.");
...
// Define attachments.
const base64Attachment = {
  base64file:
    "iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAF3klEQVR4Xt2aMcolRRSFdQUuwSW4AAMzU8ENzAIMDA1NzHUBgqmZkbG4ADGVQRgGZBBElAERRPg9eC+PQ73qc6u66lZ3v48bzH+7uqr6VN/T1f3mjafT8Pr7b37+8G3En99+5akTcAqB/n7+48uP3vvp3TdvgT//+uE7P3woBwv07+s/Xn32jKXhwKF/Xr3wpgdxpEC/ffnp8/ffKkQpAg3QDDr6Ocs5RiCzm0ILEQca02qB7u2mPQ4xpnUCabtBWDWFdbfYmBYJ1HLZN6PBP3794uOiAcdKY0oXKLQbFE71jkBS33FrjClRoNBuXjx7J/QUNNCdZBtTikAtdtO1+JBA34Z5xjRfIG03I/YBTYVMScY0U6DQbsbXGdevF2C6Mc0RKLQbHEUbbz0MZNKPuYnGNCpQaDdY0iQTDR9zU4xpSCB9t+PQ719/7k3T0P49bkw7BQrtZnBajTS+uIwYU7dA4ZzynrhMWF/3sc+YOgQK7WaiNQpCh9bRu36tAmm7wT2MovOmaUAaPY3G6DKmWCBtNzaYN80EJjIuDUejMSmBUC/abnCrL3Di8IEwErhA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XZTpVsgI5zKjorjHjzVjK6pkWXbKZCBm1kYU2/F8bmeakDXVJfdVBkSCGB+wpi6lo5P9FSEvpF77abKqECGNqbGiuNTPLWNrikc2mE3VeYIZOj1DCuOG3uqhq6pEbupMlMgA7PfMiY9e27pqTvEGozbTZX5AgFtTFsVx208ReiammI3VVIEMrQxYbWLS+KjnvofXVMT7aZKokCGKIqi4viQp3pOTyJdIAO3wJYx3SqOk/hT1FSS3VRZJBDQxlQUkaipPLupsk4gQxuTjmy7qbJaIEM4SzXW2E2VYwQyhDHdYqXdVDlSIKCNabHdVDlYIOPemA6xmyqnEMgwYzrQbio8Pf0HxndUxitiwgUAAAAASUVORK5CYII=",
  inLine: true,
  name: "script_lab.png",
  type: Office.MailboxEnums.AttachmentType.Base64
};
const fileAttachment = {
  inLine: true,
  name: "dog.jpg",
  type: Office.MailboxEnums.AttachmentType.File,
  url: "https://i.imgur.com/9S36xvA.jpg"
};
const itemAttachment = {
  itemId: Office.context.mailbox.item.itemId,
  name: "test_email.msg",
  type: Office.MailboxEnums.AttachmentType.Item
};
// Create the reply with attachments.
Office.context.mailbox.item.displayReplyAllForm({
  htmlBody:
    "This is a reply with an inline Base64-encoded attachment, an inline image, and an item attachment.<br><img src='cid:script_lab.png'><br><img src='cid:dog.jpg'>",
  attachments: [base64Attachment, fileAttachment, itemAttachment],
  callback: (result) => {
    if (result.status === Office.AsyncResultStatus.Failed) {
      console.error(`Action failed with message ${result.error.message}`);
      return;
    }
    console.log("Created a reply-all form with attachments.");
  }
});
		displayReplyAllFormAsync(formData, options, callback)
	     
	显示一个答复表单,其中包括所选邮件的发件人和所有收件人或组织者以及所选约会的所有与会者。
在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。
如果任意字符串参数超出其限制,displayReplyAllFormAsync 将引发异常。
在 参数中 formData.attachments 指定附件时,Outlook 会尝试下载所有附件并将其附加到答复表单。 如果无法添加任何附件,则在窗体 UI 中显示错误。 如果这不可能,则不引发错误消息。
注意:iOS 版或 Android 版 Outlook 不支持此方法。
displayReplyAllFormAsync(formData: string | ReplyFormData, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- formData
- 
				string | Office.ReplyFormData 
一个包含文本和 HTML 且表示答复窗体的正文的字符串。 字符串限制为 32 KB 或包含正文或附件数据和回调函数的 ReplyFormData 对象。
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/55-display-items/display-reply-forms.yaml
Office.context.mailbox.item.displayReplyAllFormAsync("This is a reply ALL with <b>some bold text</b>.", function(
  asyncResult
) {
  console.log(JSON.stringify(asyncResult));
});
...
// Define attachments.
const base64Attachment = {
  base64file:
    "iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAF3klEQVR4Xt2aMcolRRSFdQUuwSW4AAMzU8ENzAIMDA1NzHUBgqmZkbG4ADGVQRgGZBBElAERRPg9eC+PQ73qc6u66lZ3v48bzH+7uqr6VN/T1f3mjafT8Pr7b37+8G3En99+5akTcAqB/n7+48uP3vvp3TdvgT//+uE7P3woBwv07+s/Xn32jKXhwKF/Xr3wpgdxpEC/ffnp8/ffKkQpAg3QDDr6Ocs5RiCzm0ILEQca02qB7u2mPQ4xpnUCabtBWDWFdbfYmBYJ1HLZN6PBP3794uOiAcdKY0oX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g5nBgyI8S5xCIIMHzbCbKjwowrPESQXyVD48aHXcWCDc7dm/Wxk8qKcymfZN2gJ+mfqDDODhPJUDLmTrAeotiFaBLJI2IwYP5KnZ2IaeByrC2xEVgdCFeCfIqzgexVNT0T9Ab30VqAgEwneCjIrj/j01CVFTFuKrQF0gQ/wCaQHJJ1Yc9+ypYcKawgXqrwJKIEPfmRMrjrv11BhTZh4LZGAdhDFNqTju0FN70TW1ZTdVWgUCoTFh1JGK46481U9YU70fITsEMrQxjVQc9+OpTnRNhXZTpVsgI5zKjorjHjzVjK6pkWXbKZCBm1kYU2/F8bmeakDXVJfdVBkSCGB+wpi6lo5P9FSEvpF77abKqECGNqbGiuNTPLWNrikc2mE3VeYIZOj1DCuOG3uqhq6pEbupMlMgA7PfMiY9e27pqTvEGozbTZX5AgFtTFsVx208ReiammI3VVIEMrQxYbWLS+KjnvofXVMT7aZKokCGKIqi4viQp3pOTyJdIAO3wJYx3SqOk/hT1FSS3VRZJBDQxlQUkaipPLupsk4gQxuTjmy7qbJaIEM4SzXW2E2VYwQyhDHdYqXdVDlSIKCNabHdVDlYIOPemA6xmyqnEMgwYzrQbio8Pf0HxndUxitiwgUAAAAASUVORK5CYII=",
  inLine: true,
  name: "script_lab.png",
  type: Office.MailboxEnums.AttachmentType.Base64
};
const fileAttachment = {
  inLine: true,
  name: "dog.jpg",
  type: Office.MailboxEnums.AttachmentType.File,
  url: "https://i.imgur.com/9S36xvA.jpg"
};
const itemAttachment = {
  itemId: Office.context.mailbox.item.itemId,
  name: "test_email.msg",
  type: Office.MailboxEnums.AttachmentType.Item
};
// The async version was introduced in requirement set 1.9.
// It provides a callback when the new appointment form has been created.
Office.context.mailbox.item.displayReplyAllFormAsync(
  {
    htmlBody:
      "This is a reply with an inline Base64-encoded attachment, an inline image, and an item attachment.<br><img src='cid:script_lab.png'><br><img src='cid:dog.jpg'>",
    attachments: [base64Attachment, fileAttachment, itemAttachment]
  },
  (asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Failed) {
      console.error(`Action failed with message ${asyncResult.error.message}`);
      return;
    }
    console.log("Created a reply-all form with attachments.");
  }
);
		displayReplyAllFormAsync(formData, callback)
	     
	显示一个答复表单,其中包括所选邮件的发件人和所有收件人或组织者以及所选约会的所有与会者。
在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。
如果任意字符串参数超出其限制,displayReplyAllFormAsync 将引发异常。
在 参数中 formData.attachments 指定附件时,Outlook 会尝试下载所有附件并将其附加到答复表单。 如果无法添加任何附件,则在窗体 UI 中显示错误。 如果这不可能,则不引发错误消息。
注意:iOS 版或 Android 版 Outlook 不支持此方法。
displayReplyAllFormAsync(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- formData
- 
				string | Office.ReplyFormData 
一个包含文本和 HTML 且表示答复窗体的正文的字符串。 字符串限制为 32 KB 或包含正文或附件数据和回调函数的 ReplyFormData 对象。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
		displayReplyForm(formData)
	   
	显示答复窗体,其中仅包括所选邮件的发件人或所选约会的组织者。
displayReplyForm(formData: string | ReplyFormData): void;参数
- formData
- 
				string | Office.ReplyFormData 
一个包含文本和 HTML 且表示答复窗体的正文的字符串。 字符串限制为 32 KB 或包含正文或附件数据和回调函数的 ReplyFormData 对象。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。 
- 如果任意字符串参数超出其限制, - displayReplyForm将引发异常。
- 在 参数中 - formData.attachments指定附件时,Outlook 会尝试下载所有附件并将其附加到答复表单。 如果无法添加任何附件,则在窗体 UI 中显示错误。 如果这不可能,则不引发错误消息。
- Android 版或 iOS 版 Outlook 不支持此方法。 有关 Outlook mobile 中支持的 API 的详细信息,请参阅移动设备上的 Outlook 中支持的 Outlook JavaScript API。 
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/55-display-items/display-reply-forms.yaml
Office.context.mailbox.item.displayReplyForm("This is a reply with <i>some text in italics</i>.");
...
// Define attachments.
const base64Attachment = {
  base64file:
    "iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAF3klEQVR4Xt2aMcolRRSFdQUuwSW4AAMzU8ENzAIMDA1NzHUBgqmZkbG4ADGVQRgGZBBElAERRPg9eC+PQ73qc6u66lZ3v48bzH+7uqr6VN/T1f3mjafT8Pr7b37+8G3En99+5akTcAqB/n7+48uP3vvp3TdvgT//+uE7P3woBwv07+s/Xn32jKXhwKF/Xr3wpgdxpEC/ffnp8/ffKkQpAg3QDDr6Ocs5RiCzm0ILEQca02qB7u2mPQ4xpnUCabtBWDWFdbfYmBYJ1HLZN6PBP3794uOiAcdKY0oXKLQbFE71jkBS33FrjClRoNBuXjx7J/QUNNCdZBtTikAtdtO1+JBA34Z5xjRfIG03I/YBTYVMScY0U6DQbsbXGdevF2C6Mc0RKLQbHEUbbz0MZNKPuYnGNCpQaDdY0iQTDR9zU4xpSCB9t+PQ719/7k3T0P49bkw7BQrtZnBajTS+uIwYU7dA4ZzynrhMWF/3sc+YOgQK7WaiNQpCh9bRu36tAmm7wT2MovOmaUAaPY3G6DKmWCBtNzaYN80EJjIuDUejMSmBUC/abnCrL3Di8IEwErhAvUGrCxRa4C+ffLDAicMVmhW42K2VLgUK67zlFXwcqL9GmltseUXlDirOvMXIbqKdHc/vieGTIJoE6rL93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abKqECGNqbGiuNTPLWNrikc2mE3VeYIZOj1DCuOG3uqhq6pEbupMlMgA7PfMiY9e27pqTvEGozbTZX5AgFtTFsVx208ReiammI3VVIEMrQxYbWLS+KjnvofXVMT7aZKokCGKIqi4viQp3pOTyJdIAO3wJYx3SqOk/hT1FSS3VRZJBDQxlQUkaipPLupsk4gQxuTjmy7qbJaIEM4SzXW2E2VYwQyhDHdYqXdVDlSIKCNabHdVDlYIOPemA6xmyqnEMgwYzrQbio8Pf0HxndUxitiwgUAAAAASUVORK5CYII=",
  inLine: true,
  name: "script_lab.png",
  type: Office.MailboxEnums.AttachmentType.Base64
};
const fileAttachment = {
  inLine: true,
  name: "dog.jpg",
  type: Office.MailboxEnums.AttachmentType.File,
  url: "https://i.imgur.com/9S36xvA.jpg"
};
const itemAttachment = {
  itemId: Office.context.mailbox.item.itemId,
  name: "test_email.msg",
  type: Office.MailboxEnums.AttachmentType.Item
};
// Create the reply with attachments.
Office.context.mailbox.item.displayReplyForm({
  htmlBody:
    "This is a reply with an inline Base64-encoded attachment, an inline image, and an item attachment.<br><img src='cid:script_lab.png'><br><img src='cid:dog.jpg'>",
  attachments: [base64Attachment, fileAttachment, itemAttachment],
  callback: (result) => {
    if (result.status === Office.AsyncResultStatus.Failed) {
      console.error(`Action failed with message ${result.error.message}`);
      return;
    }
    console.log("Created a reply with attachments.");
  }
});
		displayReplyFormAsync(formData, options, callback)
	    
	显示答复窗体,其中仅包括所选邮件的发件人或所选约会的组织者。
在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。
如果任意字符串参数超出其限制,displayReplyFormAsync 将引发异常。
在 参数中 formData.attachments 指定附件时,Outlook 会尝试下载所有附件并将其附加到答复表单。 如果无法添加任何附件,则在窗体 UI 中显示错误。 如果这不可能,则不引发错误消息。
注意:iOS 版或 Android 版 Outlook 不支持此方法。
displayReplyFormAsync(formData: string | ReplyFormData, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- formData
- 
				string | Office.ReplyFormData 
一个包含文本和 HTML 且表示答复窗体的正文的字符串。 字符串限制为 32 KB 或包含正文或附件数据和回调函数的 ReplyFormData 对象。
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/55-display-items/display-reply-forms.yaml
Office.context.mailbox.item.displayReplyFormAsync("This is a reply with <i>some text in italics</i>.", function(
  asyncResult
) {
  console.log(JSON.stringify(asyncResult));
});
...
// Define attachments.
const base64Attachment = {
  base64file:
    "iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAF3klEQVR4Xt2aMcolRRSFdQUuwSW4AAMzU8ENzAIMDA1NzHUBgqmZkbG4ADGVQRgGZBBElAERRPg9eC+PQ73qc6u66lZ3v48bzH+7uqr6VN/T1f3mjafT8Pr7b37+8G3En99+5akTcAqB/n7+48uP3vvp3TdvgT//+uE7P3woBwv07+s/Xn32jKXhwKF/Xr3wpgdxpEC/ffnp8/ffKkQpAg3QDDr6Ocs5RiCzm0ILEQca02qB7u2mPQ4xpnUCabtBWDWFdbfYmBYJ1HLZN6PBP3794uOiAcdKY0oXKLQbFE71jkBS33FrjClRoNBuXjx7J/QUNNCdZBtTikAtdtO1+JBA34Z5xjRfIG03I/YBTYVMScY0U6DQbsbXGdevF2C6Mc0RKLQbHEUbbz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eByrC2xEVgdCFeCfIqzgexVNT0T9Ab30VqAgEwneCjIrj/j01CVFTFuKrQF0gQ/wCaQHJJ1Yc9+ypYcKawgXqrwJKIEPfmRMrjrv11BhTZh4LZGAdhDFNqTju0FN70TW1ZTdVWgUCoTFh1JGK46481U9YU70fITsEMrQxjVQc9+OpTnRNhXZTpVsgI5zKjorjHjzVjK6pkWXbKZCBm1kYU2/F8bmeakDXVJfdVBkSCGB+wpi6lo5P9FSEvpF77abKqECGNqbGiuNTPLWNrikc2mE3VeYIZOj1DCuOG3uqhq6pEbupMlMgA7PfMiY9e27pqTvEGozbTZX5AgFtTFsVx208ReiammI3VVIEMrQxYbWLS+KjnvofXVMT7aZKokCGKIqi4viQp3pOTyJdIAO3wJYx3SqOk/hT1FSS3VRZJBDQxlQUkaipPLupsk4gQxuTjmy7qbJaIEM4SzXW2E2VYwQyhDHdYqXdVDlSIKCNabHdVDlYIOPemA6xmyqnEMgwYzrQbio8Pf0HxndUxitiwgUAAAAASUVORK5CYII=",
  inLine: true,
  name: "script_lab.png",
  type: Office.MailboxEnums.AttachmentType.Base64
};
const fileAttachment = {
  inLine: true,
  name: "dog.jpg",
  type: Office.MailboxEnums.AttachmentType.File,
  url: "https://i.imgur.com/9S36xvA.jpg"
};
const itemAttachment = {
  itemId: Office.context.mailbox.item.itemId,
  name: "test_email.msg",
  type: Office.MailboxEnums.AttachmentType.Item
};
// The async version was introduced in requirement set 1.9.
// It provides a callback when the new appointment form has been created.
Office.context.mailbox.item.displayReplyFormAsync(
  {
    htmlBody:
      "This is a reply with an inline Base64-encoded attachment, an inline image, and an item attachment.<br><img src='cid:script_lab.png'><br><img src='cid:dog.jpg'>",
    attachments: [base64Attachment, fileAttachment, itemAttachment]
  },
  (asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Failed) {
      console.error(`Action failed with message ${asyncResult.error.message}`);
      return;
    }
    console.log("Created reply with attachments.");
  }
);
		displayReplyFormAsync(formData, callback)
	    
	显示答复窗体,其中仅包括所选邮件的发件人或所选约会的组织者。
在Outlook 网页版和新的 Outlook on Windows 中,答复窗体在 3 列视图中显示为弹出窗体,在 2 列或 1 列视图中显示为弹出窗体。
如果任意字符串参数超出其限制,displayReplyFormAsync 将引发异常。
在 参数中 formData.attachments 指定附件时,Outlook 会尝试下载所有附件并将其附加到答复表单。 如果无法添加任何附件,则在窗体 UI 中显示错误。 如果这不可能,则不引发错误消息。
注意:iOS 版或 Android 版 Outlook 不支持此方法。
displayReplyFormAsync(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- formData
- 
				string | Office.ReplyFormData 
一个包含文本和 HTML 且表示答复窗体的正文的字符串。 字符串限制为 32 KB 或包含正文或附件数据和回调函数的 ReplyFormData 对象。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
		getAttachmentContentAsync(attachmentId, options, callback)
	    
	从邮件或约会中获取附件,并将其作为 AttachmentContent 对象返回。
getAttachmentContentAsync(attachmentId: string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<AttachmentContent>) => void): void;参数
- attachmentId
- 
				string 
要获取的附件的标识符。
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<Office.AttachmentContent>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。 如果调用失败,属性 asyncResult.error 将包含错误代码,其中包含失败的原因。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 方法 - getAttachmentContentAsync从项中获取具有指定标识符的附件。 最佳做法是,应从 item.attachments 调用获取附件的标识符,然后在同一会话中使用该标识符来检索附件。
- 在Outlook 网页版和新的 Outlook on Windows 中, - getAttachmentContentAsync不支持使用“上传和共享”选项添加的附件。
- 在 Outlook 网页版、移动设备和新的 Outlook on Windows 中,附件标识符仅在同一会话中有效。 当用户关闭应用时,会话结束,或者如果用户开始撰写内联窗体,然后弹出窗体以在单独的窗口中继续。 
错误:
- AttachmentTypeNotSupported:不支持附件类型。 不支持的类型包括 RTF 格式的嵌入图像,或者电子邮件或日历项目以外的项目附件类型 (,例如联系人或任务项) 。
- InvalidAttachmentId:附件标识符不存在。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/40-attachments/get-attachment-content.yaml
// Gets the attachments of the current message or appointment in read mode. The item.attachments call can only be used in read mode.
const item = Office.context.mailbox.item;
const attachments = item.attachments;
if (attachments.length <= 0) {
  console.log("Mail item has no attachments.");
  return;
}
for (let i = 0; i < attachments.length; i++) {
  // Log the attachment type and its contents to the console.
  item.getAttachmentContentAsync(attachments[i].id, handleAttachmentsCallback);
}
		getAttachmentContentAsync(attachmentId, callback)
	    
	从邮件或约会中获取附件,并将其作为 AttachmentContent 对象返回。
getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult<AttachmentContent>) => void): void;参数
- attachmentId
- 
				string 
要获取的附件的标识符。
- callback
- 
				(asyncResult: Office.AsyncResult<Office.AttachmentContent>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。 如果调用失败,属性 asyncResult.error 将包含错误代码,其中包含失败的原因。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 方法 - getAttachmentContentAsync从项中获取具有指定标识符的附件。 最佳做法是,应从 item.attachments 调用获取附件的标识符,然后在同一会话中使用该标识符来检索附件。
- 在Outlook 网页版和新的 Outlook on Windows 中, - getAttachmentContentAsync不支持使用“上传和共享”选项添加的附件。
- 在 Outlook 网页版、移动设备和新的 Outlook on Windows 中,附件标识符仅在同一会话中有效。 当用户关闭应用时,会话结束,或者如果用户开始撰写内联窗体,然后弹出窗体以在单独的窗口中继续。 
错误:
- AttachmentTypeNotSupported:不支持附件类型。 不支持的类型包括 RTF 格式的嵌入图像,或者电子邮件或日历项目以外的项目附件类型 (,例如联系人或任务项) 。
- InvalidAttachmentId:附件标识符不存在。
		getEntities()
	 
	获取在所选项目的正文中找到的实体。
警告:基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。
getEntities(): Entities;返回
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
		getEntitiesByType(entityType)
	   
	获取所选项目的正文中找到的指定实体类型的所有实体的数组。
警告:基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。
getEntitiesByType(entityType: MailboxEnums.EntityType | string): Array<string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion>;参数
- entityType
- 
				Office.MailboxEnums.EntityType | string 
枚举值之 EntityType 一。
返回
Array<string | Office.Contact | Office.MeetingSuggestion | Office.PhoneNumber | Office.TaskSuggestion>
如果在 entityType 中传递的值不是 EntityType 枚举的有效成员,该方法返回 null。 如果指定类型的任何实体都不存在于该项目的正文中,该方法将返回空数组。 否则,返回的数组中对象的类型取决于 entityType 参数中请求实体的类型。
注解
最低权限级别: 受限
适用的 Outlook 模式:约会与会者
		getFilteredEntitiesByName(name)
	   
	返回所选项中的已知实体,这些实体通过仅外接程序清单文件中定义的命名筛选器。
警告:基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。
getFilteredEntitiesByName(name: string): Array<string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion>;参数
- name
- 
				string 
定义筛选器匹配的 ItemHasKnownEntity 规则元素的名称。
返回
Array<string | Office.Contact | Office.MeetingSuggestion | Office.PhoneNumber | Office.TaskSuggestion>
与外接程序清单文件中的规则元素中 ItemHasKnownEntity 定义的正则表达式匹配的实体,这些实体具有指定的 FilterName 元素值。 如果清单中没有 ItemHasKnownEntity 元素,其 FilterName 元素值与 参数匹配 name ,则 该方法返回 null。 
              name如果 参数与清单中的元素匹配ItemHasKnownEntity,但当前项中没有匹配的实体,则 该方法将返回一个空数组。
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
		getInitializationContextAsync(options, callback)
	   
	获取当 加载项被可作消息激活时传递的初始化数据。
getInitializationContextAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult<string>) => void): void;参数
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<string>) => void 
方法完成后,使用类型的Office.AsyncResult单个参数调用在 参数中callback传递的函数。 成功时,初始化上下文数据以字符串 (或空字符串的形式提供(如果 属性中 asyncResult.value 没有初始化上下文) )。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Get the initialization context (if present).
Office.context.mailbox.item.getInitializationContextAsync((asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
        if (asyncResult.value.length > 0) {
            // The value is a string, parse to an object.
            const context = JSON.parse(asyncResult.value);
            // Do something with context.
        } else {
            // Empty context, treat as no context.
        }
    } else {
        // Handle the error.
    }
});
		getInitializationContextAsync(callback)
	   
	获取当 加载项被可作消息激活时传递的初始化数据。
getInitializationContextAsync(callback: (asyncResult: Office.AsyncResult<string>) => void): void;参数
- callback
- 
				(asyncResult: Office.AsyncResult<string>) => void 
方法完成后,使用类型的Office.AsyncResult单个参数调用在 参数中callback传递的函数。 成功时,初始化上下文数据以字符串 (或空字符串的形式提供(如果 属性中 asyncResult.value 没有初始化上下文) )。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
		getRegExMatches()
	  
	返回所选项中与仅外接程序清单文件中定义的正则表达式匹配的字符串值。
getRegExMatches(): any;返回
any
一个 对象,该对象包含与外接程序清单文件中定义的正则表达式匹配的字符串数组。 每个数组的名称等于匹配 ItemHasRegularExpressionMatch 规则的 RegExName 属性的相应值。 
              ItemHasRegularExpressionMatch对于规则,匹配的字符串必须出现在由该规则指定的项的 属性中。 简单类型定义支持的属性。
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。 
- 此方法与 Outlook 加载项的激活规则功能一起使用,Microsoft 365 的统一清单不支持此功能。 
- 如果在项的 body 属性上指定 - ItemHasRegularExpressionMatch规则,则正则表达式应进一步筛选正文,并且不应尝试返回项的整个正文。 使用等- .*正则表达式获取项的整个正文并不总是返回预期结果。 而是使用- Body.getAsync方法检索整个正文。
- Android 版或 iOS 版 Outlook 不支持此方法。 有关 Outlook mobile 中支持的 API 的详细信息,请参阅移动设备上的 Outlook 中支持的 Outlook JavaScript API。 
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/75-regex-matches/contextual.yaml
// This API only works when you click on the highlighted word "ScriptLab".
console.log(Office.context.mailbox.item.getRegExMatches());
		getRegExMatchesByName(name)
	   
	返回所选项中与仅外接程序清单文件中定义的命名正则表达式匹配的字符串值。
getRegExMatchesByName(name: string): string[];参数
- name
- 
				string 
定义筛选器匹配的 ItemHasRegularExpressionMatch 规则元素的名称。
返回
string[]
一个数组,其中包含与外接程序清单文件中的规则元素中 ItemHasRegularExpressionMatch 定义的正则表达式匹配的字符串,以及指定的 RegExName 元素值。
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。 
- 此方法与 Outlook 加载项的激活规则功能一起使用,Microsoft 365 的统一清单不支持此功能。 
- 如果在项的 body 属性上指定 - ItemHasRegularExpressionMatch规则,则正则表达式应进一步筛选正文,并且不应尝试返回项的整个正文。 使用等- .*正则表达式获取项的整个正文并不总是返回预期结果。 而是使用- Body.getAsync方法检索整个正文。
- Android 版或 iOS 版 Outlook 不支持此方法。 有关 Outlook mobile 中支持的 API 的详细信息,请参阅移动设备上的 Outlook 中支持的 Outlook JavaScript API。 
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/75-regex-matches/contextual.yaml
// This API only works when you click on the highlighted word "ScriptLab".
console.log(Office.context.mailbox.item.getRegExMatchesByName("sampleRegexName"));
		getSelectedEntities()
	  
	获取在用户已选择的突出显示匹配项中找到的实体。 突出显示的匹配项适用于上下文外接程序。
警告:基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。
getSelectedEntities(): Entities;返回
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
		getSelectedRegExMatches()
	   
	返回突出显示的匹配项中的字符串值,该值与仅外接程序清单文件中定义的正则表达式匹配。 突出显示的匹配项适用于上下文外接程序。
getSelectedRegExMatches(): any;返回
any
一个 对象,该对象包含与外接程序清单文件中定义的正则表达式匹配的字符串数组。 每个数组的名称等于匹配ItemHasRegularExpressionMatch规则的 属性的RegExName相应值。 
              ItemHasRegularExpressionMatch对于规则,匹配的字符串必须出现在由该规则指定的项的 属性中。 简单类型定义支持的属性。
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
重要说明:
- 基于实体的上下文 Outlook 加载项现已停用。 但是,仍支持正则表达式规则。 建议更新上下文加载项,以使用正则表达式规则作为替代解决方案。 有关如何实现这些规则的指南,请参阅 上下文 Outlook 加载项。 
- 此方法与 Outlook 加载项的激活规则功能一起使用,Microsoft 365 的统一清单不支持此功能。 
- iOS 或 Android 版 Outlook 不支持此方法。 有关 Outlook mobile 中支持的 API 的详细信息,请参阅移动设备上的 Outlook 中支持的 Outlook JavaScript API。 
- 如果在项的 body 属性上指定 - ItemHasRegularExpressionMatch规则,则正则表达式应进一步筛选正文,并且不应尝试返回项的整个正文。 使用 .* 等正则表达式获取项的整个正文并不总是返回预期结果。 而是使用- Body.getAsync方法检索整个正文。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/75-regex-matches/contextual.yaml
const matches = Office.context.mailbox.item.getSelectedRegExMatches();
if (matches) {
    console.log(matches);
} else {
    console.error("Open add-in by clicking on a highlighted regex match, for this API to return something useful.");
}
		getSharedPropertiesAsync(options, callback)
	   
	获取共享文件夹或共享邮箱中约会或邮件的属性。
有关使用此 API 的详细信息,请参阅 在 Outlook 外接程序中启用共享文件夹和共享邮箱方案。
getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult<SharedProperties>) => void): void;参数
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<Office.SharedProperties>) => void 
方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。 属性 asyncResult.value 提供共享项的属性。
返回
void
注解
[ API set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support ]
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
注意:iOS 版或 Android 版 Outlook 不支持此方法。
		getSharedPropertiesAsync(callback)
	   
	获取共享文件夹或共享邮箱中约会或邮件的属性。
有关使用此 API 的详细信息,请参阅 在 Outlook 外接程序中启用共享文件夹和共享邮箱方案。
getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult<SharedProperties>) => void): void;参数
- callback
- 
				(asyncResult: Office.AsyncResult<Office.SharedProperties>) => void 
方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。 属性 asyncResult.value 提供共享项的属性。
返回
void
注解
[ API set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support ]
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
注意:iOS 版或 Android 版 Outlook 不支持此方法。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/65-delegates-and-shared-folders/get-shared-properties.yaml
Office.context.mailbox.item.getSharedPropertiesAsync((result) => {
  if (result.status === Office.AsyncResultStatus.Failed) {
    console.error("The current folder or mailbox isn't shared.");
    return;
  }
  const sharedProperties = result.value;
  console.log(`Owner: ${sharedProperties.owner}`);
  console.log(`Permissions: ${sharedProperties.delegatePermissions}`);
  console.log(`Target mailbox: ${sharedProperties.targetMailbox}`);
});
		loadCustomPropertiesAsync(callback, userContext)
	    
	异步加载所选项目上此外接程序的自定义属性。
自定义属性以键值对的形式存储在每个应用、每个项目的基础上。 此方法在回调中返回 CustomProperties 对象,该对象提供访问特定于当前项和当前加载项的自定义属性的方法。 自定义属性不会对项进行加密,因此不应将其用作安全存储。
自定义属性作为 asyncResult.value 属性中的 CustomProperties 对象提供。 此对象可用于从邮件项获取、设置、保存和删除自定义属性。
loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult<CustomProperties>) => void, userContext?: any): void;参数
- callback
- 
				(asyncResult: Office.AsyncResult<Office.CustomProperties>) => void 
方法完成后,使用类型的Office.AsyncResult单个参数调用在 参数中callback传递的函数。
- userContext
- 
				any 
可选。 开发人员可以提供他们想要在回调函数中访问的任何对象。 此对象可以通过回调函数中的 asyncResult.asyncContext 属性进行访问。
返回
void
注解
若要了解有关自定义属性的详细信息,请参阅 获取和设置 Outlook 外接程序的外接程序元数据。
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/15-item-custom-properties/load-set-get-save.yaml
Office.context.mailbox.item.loadCustomPropertiesAsync((result) => {
  if (result.status === Office.AsyncResultStatus.Failed) {
    console.error(`loadCustomPropertiesAsync failed with message ${result.error.message}`);
    return;
  }
  customProps = result.value;
  console.log("Loaded the CustomProperties object.");
});
		removeHandlerAsync(eventType, options, callback)
	   
	删除受支持事件类型的事件处理程序。 注意:事件仅适用于任务窗格实现。
有关支持的事件,请参阅 Item 对象模型 事件部分。
removeHandlerAsync(eventType: Office.EventType | string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- eventType
- 
				Office.EventType | string 
应撤销处理程序的事件。
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
		removeHandlerAsync(eventType, callback)
	   
	删除受支持事件类型的事件处理程序。 注意:事件仅适用于任务窗格实现。
有关支持的事件,请参阅 Item 对象模型 事件部分。
removeHandlerAsync(eventType: Office.EventType | string, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- eventType
- 
				Office.EventType | string 
应撤销处理程序的事件。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:约会与会者
示例
Office.context.mailbox.item.removeHandlerAsync(Office.EventType.InfobarClicked, (asyncResult) => {
    if (asyncResult.status === Office.AsyncResultStatus.Failed) {
        console.error("Failed to remove event handler: " + asyncResult.error.message);
        return;
    }
    console.log("Event handler removed successfully.");
});