PowerPoint.Binding class

プレゼンテーションで定義されている Office.js バインディングを表します。

Extends

注釈

API セット: PowerPointApi 1.8

使用元

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/binding-to-shapes.yaml

async function getShapeForBindingId(bindingId: string): Promise<PowerPoint.Shape | undefined> {
  // Gets shape associated with binding ID.
  return PowerPoint.run(async (context) => {
    const binding = context.presentation.bindings.getItem(bindingId);
    const shape = binding.getShape();
    return shape;
  });
}

プロパティ

context

オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。

id

バインド識別子を表します。

type

バインドの種類を返します。 詳細は「BindingType」をご覧ください。

メソッド

delete()

バインドを削除します。

getShape()

バインドによって表される図形を返します。 バインドが正しい型でない場合はエラーをスローします。

load(options)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNames)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNamesAndPaths)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

toJSON()

API オブジェクトが JSON.stringify() に渡されるときに、より有用な出力を提供するために、JavaScript toJSON() メソッドをオーバーライドします。 (次に、JSON.stringify渡されたオブジェクトの toJSON メソッドを呼び出します)。元の PowerPoint.Binding オブジェクトが API オブジェクトであるのに対し、 toJSON メソッドは、元のオブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト ( PowerPoint.Interfaces.BindingData と型指定) を返します。

プロパティの詳細

context

オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。

context: RequestContext;

プロパティ値

id

バインド識別子を表します。

readonly id: string;

プロパティ値

string

注釈

API セット: PowerPointApi 1.8

type

バインドの種類を返します。 詳細は「BindingType」をご覧ください。

readonly type: PowerPoint.BindingType | "Shape";

プロパティ値

注釈

API セット: PowerPointApi 1.8

メソッドの詳細

delete()

バインドを削除します。

delete(): void;

返品

void

注釈

API セット: PowerPointApi 1.8

getShape()

バインドによって表される図形を返します。 バインドが正しい型でない場合はエラーをスローします。

getShape(): PowerPoint.Shape;

返品

注釈

API セット: PowerPointApi 1.8

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/binding-to-shapes.yaml

async function getShapeForBindingId(bindingId: string): Promise<PowerPoint.Shape | undefined> {
  // Gets shape associated with binding ID.
  return PowerPoint.run(async (context) => {
    const binding = context.presentation.bindings.getItem(bindingId);
    const shape = binding.getShape();
    return shape;
  });
}

load(options)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(options?: PowerPoint.Interfaces.BindingLoadOptions): PowerPoint.Binding;

パラメーター

options
PowerPoint.Interfaces.BindingLoadOptions

読み込むオブジェクトのプロパティのオプションを指定します。

返品

load(propertyNames)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNames?: string | string[]): PowerPoint.Binding;

パラメーター

propertyNames

string | string[]

読み込むプロパティを指定するコンマ区切りの文字列または文字列の配列。

返品

load(propertyNamesAndPaths)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNamesAndPaths?: {
            select?: string;
            expand?: string;
        }): PowerPoint.Binding;

パラメーター

propertyNamesAndPaths

{ select?: string; expand?: string; }

propertyNamesAndPaths.select は読み込むプロパティを指定するコンマ区切りの文字列であり、 propertyNamesAndPaths.expand は読み込むナビゲーションのプロパティを指定するコンマ区切りの文字列です。

返品

toJSON()

API オブジェクトが JSON.stringify() に渡されるときに、より有用な出力を提供するために、JavaScript toJSON() メソッドをオーバーライドします。 (次に、JSON.stringify渡されたオブジェクトの toJSON メソッドを呼び出します)。元の PowerPoint.Binding オブジェクトが API オブジェクトであるのに対し、 toJSON メソッドは、元のオブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト ( PowerPoint.Interfaces.BindingData と型指定) を返します。

toJSON(): PowerPoint.Interfaces.BindingData;

返品