次の方法で共有


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;

戻り値