Office.Recurrence interface 
对象 Recurrence 提供用于获取和设置约会的重复模式的方法,但仅获取会议请求的重复模式。 它将具有包含以下键的字典: seriesTime、 recurrenceType、 recurrenceProperties和 recurrenceTimeZone (可选) 。
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
状态
| 状态 | 编辑? | 可见? | 
|---|---|---|
| 约会组织者 - Compose系列 | 是 (setAsync) | 是 (getAsync) | 
| 约会组织者 - Compose 实例 | 无 (setAsync 返回错误) | 是 (getAsync) | 
| 约会与会者 - 阅读系列 | 无 (setAsync 不可用) | 是 (item.recurrence) | 
| 约会与会者 - 读取实例 | 无 (setAsync 不可用) | 是 (item.recurrence) | 
| 会议请求 - 读取系列 | 无 (setAsync 不可用) | 是 (item.recurrence) | 
| 会议请求 - 读取实例 | 无 (setAsync 不可用) | 是 (item.recurrence) | 
属性
| recurrence | 获取或设置定期约会系列的属性。 | 
| recurrence | 获取或设置定期约会系列的属性。 | 
| recurrence | 获取或设置定期约会系列的类型。 | 
| series | 
              使用 SeriesTime 对象,可以管理定期约会系列的开始和结束日期以及实例的通常开始和结束时间。 此对象不在 UTC 时间。 而是在值指定的  | 
方法
| get | 返回约会系列的当前定期对象。 此方法返回约会系列的整个  | 
| get | 返回约会系列的当前定期对象。 此方法返回约会系列的整个  | 
| set | 设置约会系列的重复模式。 | 
| set | 设置约会系列的重复模式。 | 
属性详细信息
		recurrenceProperties
	 
	获取或设置定期约会系列的属性。
recurrenceProperties?: RecurrenceProperties;属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
		recurrenceTimeZone
	  
	获取或设置定期约会系列的属性。
recurrenceTimeZone?: RecurrenceTimeZone;属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
		recurrenceType
	 
	获取或设置定期约会系列的类型。
recurrenceType: MailboxEnums.RecurrenceType | string;属性值
Office.MailboxEnums.RecurrenceType | string
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
		seriesTime
	 
	
              使用 SeriesTime 对象,可以管理定期约会系列的开始和结束日期以及实例的通常开始和结束时间。 此对象不在 UTC 时间。 而是在值指定的 recurrenceTimeZone 时区中设置,或默认为项的时区。
seriesTime: SeriesTime;属性值
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
方法详细信息
		getAsync(options, callback)
	 
	返回约会系列的当前定期对象。
此方法返回约会系列的整个 Recurrence 对象。
getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<Recurrence>) => void): void;参数
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<Office.Recurrence>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。 
              value结果的 属性是 对象Recurrence。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-appointment-organizer.yaml
Office.context.mailbox.item.recurrence.getAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    const recurrence = asyncResult.value;
    if (recurrence === null) {
      console.log("This is a single appointment.");
    } else {
      console.log(`Recurrence pattern: ${JSON.stringify(recurrence)}`);
    }
  } else {
    console.error(asyncResult.error);
  }
});
		getAsync(callback)
	 
	返回约会系列的当前定期对象。
此方法返回约会系列的整个 Recurrence 对象。
getAsync(callback?: (asyncResult: Office.AsyncResult<Recurrence>) => void): void;参数
- callback
- 
				(asyncResult: Office.AsyncResult<Office.Recurrence>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。 
              value结果的 属性是 对象Recurrence。
返回
void
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
		setAsync(recurrencePattern, options, callback)
	  
	设置约会系列的重复模式。
setAsync(recurrencePattern: Recurrence, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- recurrencePattern
- Office.Recurrence
定期对象。
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读/写项
适用的 Outlook 模式:Compose
重要说明:
- setAsync仅适用于序列项,不适用于实例项。
- 当前 - setAsync使用- loadItemByIdAsync方法加载的消息不支持 方法。 有关详细信息,请参阅 在多条消息上激活 Outlook 加载项。
错误:
- 
              InvalidEndTime:约会结束时间早于其开始时间。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-appointment-organizer.yaml
// Important: Can only set the recurrence pattern of an appointment series.
const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1, currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);
const pattern: Office.Recurrence = {
  seriesTime: seriesTimeObject,
  recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
  recurrenceProperties: {
    interval: 1,
    dayOfWeek: Office.MailboxEnums.Days.Tue,
    weekNumber: Office.MailboxEnums.WeekNumber.Second,
    month: Office.MailboxEnums.Month.Sep
  },
  recurrenceTimeZone: { name: Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};
Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) => {
  if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
    console.error(`Failed to set recurrence. Error: ${asyncResult.error.message}`);
    return;
  }
  console.log(`Succeeded in setting recurrence pattern ${JSON.stringify(pattern)}`);
});
		setAsync(recurrencePattern, callback)
	  
	设置约会系列的重复模式。
setAsync(recurrencePattern: Recurrence, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;参数
- recurrencePattern
- Office.Recurrence
定期对象。
- callback
- 
				(asyncResult: Office.AsyncResult<void>) => void 
可选。 方法完成后,使用单个参数 asyncResult(即 Office.AsyncResult 对象)调用在 参数中callback传递的函数。
返回
void
注解
最低权限级别: 读/写项
适用的 Outlook 模式:Compose
重要说明:
- setAsync仅适用于序列项,不适用于实例项。
- 当前 - setAsync使用- loadItemByIdAsync方法加载的消息不支持 方法。 有关详细信息,请参阅 在多条消息上激活 Outlook 加载项。
错误:
- 
              InvalidEndTime:约会结束时间早于其开始时间。