Office.Recurrence interface

Recurrence オブジェクトには、予定の定期的なパターンを取得して設定するメソッドが用意されていますが、会議出席依頼の定期的なパターンのみを取得するメソッドが用意されています。 このファイルには、 seriesTimerecurrenceTyperecurrencePropertiesrecurrenceTimeZone (省略可能) のキーを持つ辞書があります。

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り

適用可能な Outlook モード: Composeまたは読み取り

状態

状態 編集可能? 表示可能?
アポイントメント オーガナイザー - Compose Series はい (setAsync) はい (getAsync)
アポイントメント オーガナイザー - Compose Instance いいえ (setAsync がエラーを返します) はい (getAsync)
予定の出席者 - シリーズを読む いいえ (setAsync は使用できません) はい (item.recurrence)
予定の出席者 - インスタンスの読み取り いいえ (setAsync は使用できません) はい (item.recurrence)
会議出席依頼 - 系列閲覧 いいえ (setAsync は使用できません) はい (item.recurrence)
会議出席依頼 - インスタンスの読み取り いいえ (setAsync は使用できません) はい (item.recurrence)

使用元

プロパティ

recurrenceProperties

定期的な予定シリーズのプロパティを取得または設定します。

recurrenceTimeZone

定期的な予定シリーズのプロパティを取得または設定します。

recurrenceType

定期的な予定シリーズの種類を取得または設定します。

seriesTime

SeriesTime オブジェクトを使用すると、定期的な予定シリーズの開始日と終了日、およびインスタンスの通常の開始時刻と終了時刻を管理できます。 このオブジェクトは UTC 時刻にありません。 代わりに、 recurrenceTimeZone 値で指定されたタイム ゾーンで設定されるか、項目のタイム ゾーンに既定で設定されます。

メソッド

getAsync(options, callback)

予定系列の現在の定期的なオブジェクトを返します。

このメソッドは、予定系列の Recurrence オブジェクト全体を返します。

getAsync(callback)

予定系列の現在の定期的なオブジェクトを返します。

このメソッドは、予定系列の Recurrence オブジェクト全体を返します。

setAsync(recurrencePattern, options, callback)

予定系列の定期的なパターンを設定します。

setAsync(recurrencePattern, callback)

予定系列の定期的なパターンを設定します。

プロパティの詳細

recurrenceProperties

定期的な予定シリーズのプロパティを取得または設定します。

recurrenceProperties?: RecurrenceProperties;

プロパティ値

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り

適用可能な Outlook モード: Composeまたは読み取り

recurrenceTimeZone

定期的な予定シリーズのプロパティを取得または設定します。

recurrenceTimeZone?: RecurrenceTimeZone;

プロパティ値

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り

適用可能な Outlook モード: Composeまたは読み取り

recurrenceType

定期的な予定シリーズの種類を取得または設定します。

recurrenceType: MailboxEnums.RecurrenceType | string;

プロパティ値

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り

適用可能な Outlook モード: Composeまたは読み取り

seriesTime

SeriesTime オブジェクトを使用すると、定期的な予定シリーズの開始日と終了日、およびインスタンスの通常の開始時刻と終了時刻を管理できます。 このオブジェクトは UTC 時刻にありません。 代わりに、 recurrenceTimeZone 値で指定されたタイム ゾーンで設定されるか、項目のタイム ゾーンに既定で設定されます。

seriesTime: SeriesTime;

プロパティ値

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り

適用可能な Outlook モード: Composeまたは読み取り

メソッドの詳細

getAsync(options, callback)

予定系列の現在の定期的なオブジェクトを返します。

このメソッドは、予定系列の Recurrence オブジェクト全体を返します。

getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<Recurrence>) => void): void;

パラメーター

options
Office.AsyncContextOptions

次のプロパティの 1 つ以上を含むオブジェクト リテラル:- asyncContext: 開発者は、コールバック関数でアクセスしたいオブジェクトを指定できます。

callback

(asyncResult: Office.AsyncResult<Office.Recurrence>) => void

省略可能。 メソッドが完了すると、callback パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。 結果の value プロパティは Recurrence オブジェクトです。

返品

void

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り

適用可能な 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

省略可能。 メソッドが完了すると、callback パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。 結果の value プロパティは Recurrence オブジェクトです。

返品

void

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り

適用可能な 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

次のプロパティの 1 つ以上を含むオブジェクト リテラル:- asyncContext: 開発者は、コールバック関数でアクセスしたいオブジェクトを指定できます。

callback

(asyncResult: Office.AsyncResult<void>) => void

省略可能。 メソッドが完了すると、callback パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。

返品

void

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り/書き込み

適用可能な 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 = {
  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 as any, (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

省略可能。 メソッドが完了すると、callback パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。

返品

void

注釈

API セット: メールボックス 1.7

最小アクセス許可レベル: 項目の読み取り/書き込み

適用可能な Outlook モード: Compose

重要:

  • setAsync シリーズのアイテムに対してのみ使用でき、インスタンスのアイテムでは使用できません。

  • setAsync メソッドは、現在 loadItemByIdAsync メソッドを使用して読み込まれているメッセージではサポートされていません。 詳細については、「 複数のメッセージに対して Outlook アドインをアクティブ化する」を参照してください。

エラー:

  • InvalidEndTime : 予定の終了時刻が開始時刻より前になります。