Office.EnhancedLocation interface

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

注釈

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

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

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

重要: メールボックス要件セット 1.8 をサポートしていない Outlook クライアントで予定の場所を管理するには、代わりに Office.Location API を使用します。 シナリオに適した場所 API を選択するガイダンスについては、「Outlook で任命を作成するときに場所を取得または設定する」を参照してください

使用元

メソッド

addAsync(locationIdentifiers, options, callback)

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

addAsync(locationIdentifiers, callback)

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

getAsync(options, callback)

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

getAsync(callback)

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

removeAsync(locationIdentifiers, options, callback)

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

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

removeAsync(locationIdentifiers, callback)

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

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

メソッドの詳細

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 パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。 asyncResultstatus プロパティを確認して、呼び出しが成功したかどうかを判断します。

返品

void

注釈

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

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

適用可能な Outlook モード: Compose

エラー:

  • 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 パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。 asyncResultstatus プロパティを確認して、呼び出しが成功したかどうかを判断します。

返品

void

注釈

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

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

適用可能な Outlook モード: Compose

エラー:

  • 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 パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。 予定の場所を表す Office.LocationDetails オブジェクトの配列が asyncResult.value プロパティで返されます。

返品

void

注釈

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

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

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

重要:

  • getAsyncメソッドでは、予定の [場所] フィールドに追加された個人の連絡先グループは返されません。

  • Office.context.mailbox.item.location.setAsync を使用して場所を追加した場合、その場所の種類は Office.MailboxEnums.LocationType.Custom になります。

// 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 パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。 予定の場所を表す Office.LocationDetails オブジェクトの配列が asyncResult.value プロパティで返されます。

返品

void

注釈

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

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

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

重要:

  • getAsyncメソッドでは、予定の [場所] フィールドに追加された個人の連絡先グループは返されません。

  • Office.context.mailbox.item.location.setAsync を使用して場所を追加した場合、その場所の種類は Office.MailboxEnums.LocationType.Custom になります。

removeAsync(locationIdentifiers, options, callback)

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

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

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 パラメーターで渡された関数が、Office.AsyncResult オブジェクトである 1 つのパラメーター asyncResult を指定して呼び出されます。 asyncResultstatus プロパティを確認して、呼び出しが成功したかどうかを判断します。

返品

void

注釈

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

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

適用可能な Outlook モード: Compose

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

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

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

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

パラメーター

locationIdentifiers

Office.LocationIdentifier[]

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

callback

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

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

返品

void

注釈

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

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

適用可能な Outlook モード: Compose