Office.EnhancedLocation interface

予定の場所のセットを表します。

注釈

[ API セット: メールボックス 1.8 ]

最小アクセス許可レベル: アイテムの読み取り

適用できる Outlook モード: 新規作成または読み取り

メソッド

addAsync(locationIdentifiers, options, callback)

予定に関連付けられている場所のセットにを追加します。

addAsync(locationIdentifiers, callback)

予定に関連付けられている場所のセットにを追加します。

getAsync(options, callback)

予定に関連付けられている場所のセットを取得します。

: 予定の場所として追加された 個人用連絡先グループ は、この方法では返されません。

getAsync(callback)

予定に関連付けられている場所のセットを取得します。

: 予定の場所として追加された 個人用連絡先グループ は、この方法では返されません。

removeAsync(locationIdentifiers, options, callback)

予定に関連付けられている場所のセットを削除します。

同じ名前の場所が複数ある場合は、 で locationIdentifiers1 つだけ指定された場合でも、一致するすべての場所が削除されます。

removeAsync(locationIdentifiers, callback)

予定に関連付けられている場所のセットを削除します。

同じ名前の場所が複数ある場合は、 で locationIdentifiers1 つだけ指定された場合でも、一致するすべての場所が削除されます。

メソッドの詳細

addAsync(locationIdentifiers, options, callback)

予定に関連付けられている場所のセットにを追加します。

addAsync(locationIdentifiers: LocationIdentifier[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

パラメーター

locationIdentifiers

Office.LocationIdentifier[]

現在の場所の一覧に追加する場所。

options
Office.AsyncContextOptions

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

callback

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

オプション。 メソッドが完了すると、 パラメーターでcallback渡された関数が、 オブジェクトである 1 つのパラメーターasyncResultOffice.AsyncResultで呼び出されます。 の プロパティasyncResultstatus確認して、呼び出しが成功したかどうかを判断します。

戻り値

void

注釈

[ API セット: メールボックス 1.8 ]

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

適用できる Outlook モード: 新規作成

エラー:

  • InvalidFormatError: 指定されたデータ オブジェクトの形式が無効です。

// 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

const locations = [
  {
    id: "Contoso",
    type: Office.MailboxEnums.LocationType.Custom
  },
  {
    id: "room500@test.com",
    type: Office.MailboxEnums.LocationType.Room
  }
];
Office.context.mailbox.item.enhancedLocation.addAsync(locations, (result) => {
  if (result.status === Office.AsyncResultStatus.Succeeded) {
    console.log(`Successfully added locations ${JSON.stringify(locations)}`);
  } else {
    console.error(`Failed to add locations. Error message: ${result.error.message}`);
  }
});

addAsync(locationIdentifiers, callback)

予定に関連付けられている場所のセットにを追加します。

addAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

パラメーター

locationIdentifiers

Office.LocationIdentifier[]

現在の場所の一覧に追加する場所。

callback

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

オプション。 メソッドが完了すると、 パラメーターでcallback渡された関数が、 オブジェクトである 1 つのパラメーターasyncResultOffice.AsyncResultで呼び出されます。 の プロパティasyncResultstatus確認して、呼び出しが成功したかどうかを判断します。

戻り値

void

注釈

[ API セット: メールボックス 1.8 ]

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

適用できる Outlook モード: 新規作成

エラー:

  • InvalidFormatError: 指定されたデータ オブジェクトの形式が無効です。

getAsync(options, callback)

予定に関連付けられている場所のセットを取得します。

: 予定の場所として追加された 個人用連絡先グループ は、この方法では返されません。

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

パラメーター

options
Office.AsyncContextOptions

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

callback

(asyncResult: Office.AsyncResult<Office.LocationDetails[]>) => void

オプション。 メソッドが完了すると、 パラメーターでcallback渡された関数が、 オブジェクトである 1 つのパラメーターasyncResultOffice.AsyncResultで呼び出されます。

戻り値

void

注釈

[ API セット: メールボックス 1.8 ]

最小アクセス許可レベル: アイテムの読み取り

適用できる 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.");
  }
});

getAsync(callback)

予定に関連付けられている場所のセットを取得します。

: 予定の場所として追加された 個人用連絡先グループ は、この方法では返されません。

getAsync(callback?: (asyncResult: Office.AsyncResult<LocationDetails[]>) => void): void;

パラメーター

callback

(asyncResult: Office.AsyncResult<Office.LocationDetails[]>) => void

オプション。 メソッドが完了すると、 パラメーターでcallback渡された関数が、 オブジェクトである 1 つのパラメーターasyncResultOffice.AsyncResultで呼び出されます。

戻り値

void

注釈

[ API セット: メールボックス 1.8 ]

最小アクセス許可レベル: アイテムの読み取り

適用できる Outlook モード: 新規作成または読み取り

removeAsync(locationIdentifiers, options, callback)

予定に関連付けられている場所のセットを削除します。

同じ名前の場所が複数ある場合は、 で locationIdentifiers1 つだけ指定された場合でも、一致するすべての場所が削除されます。

removeAsync(locationIdentifiers: LocationIdentifier[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

パラメーター

locationIdentifiers

Office.LocationIdentifier[]

現在の場所の一覧から削除する場所。

options
Office.AsyncContextOptions

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

callback

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

オプション。 メソッドが完了すると、 パラメーターでcallback渡された関数が、 オブジェクトである 1 つのパラメーターasyncResultOffice.AsyncResultで呼び出されます。 の プロパティasyncResultstatus確認して、呼び出しが成功したかどうかを判断します。

戻り値

void

注釈

[ API セット: メールボックス 1.8 ]

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

適用できる 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

const locations = [
  {
    id: "Contoso",
    type: Office.MailboxEnums.LocationType.Custom
  },
  {
    id: "room500@test.com",
    type: Office.MailboxEnums.LocationType.Room
  }
];
Office.context.mailbox.item.enhancedLocation.removeAsync(locations, (result) => {
  if (result.status === Office.AsyncResultStatus.Succeeded) {
    console.log(`Successfully removed locations ${JSON.stringify(locations)}`);
  } else {
    console.error(`Failed to remove locations. Error message: ${result.error.message}`);
  }
});

removeAsync(locationIdentifiers, callback)

予定に関連付けられている場所のセットを削除します。

同じ名前の場所が複数ある場合は、 で locationIdentifiers1 つだけ指定された場合でも、一致するすべての場所が削除されます。

removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

パラメーター

locationIdentifiers

Office.LocationIdentifier[]

現在の場所の一覧から削除する場所。

callback

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

オプション。 メソッドが完了すると、 パラメーターでcallback渡された関数が、 オブジェクトである 1 つのパラメーターasyncResultOffice.AsyncResultで呼び出されます。 の プロパティasyncResultstatus確認して、呼び出しが成功したかどうかを判断します。

戻り値

void

注釈

[ API セット: メールボックス 1.8 ]

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

適用できる Outlook モード: 新規作成