powerpoint package

クラス

PowerPoint.Application
PowerPoint.Presentation
PowerPoint.RequestContext

RequestContext オブジェクトは、PowerPoint アプリケーションへの要求を容易にします。 Office アドインと PowerPoint アプリケーションは 2 つの異なるプロセスで実行されるため、アドインから PowerPoint オブジェクト モデルにアクセスするには、要求コンテキストが必要です。

インターフェイス

PowerPoint.Interfaces.BulletFormatData

を呼び出 bulletFormat.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.BulletFormatUpdateData

で使用 bulletFormat.set({ ... })する BulletFormat オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.CollectionLoadOptions

コレクションのメンバーのサブセットのみのプロパティを読み込む方法を提供します。

PowerPoint.Interfaces.ParagraphFormatData

を呼び出 paragraphFormat.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.ParagraphFormatUpdateData

で使用 paragraphFormat.set({ ... })する ParagraphFormat オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.PresentationData

を呼び出 presentation.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.PresentationLoadOptions
PowerPoint.Interfaces.ShapeCollectionData

を呼び出 shapeCollection.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.ShapeCollectionUpdateData

で使用 shapeCollection.set({ ... })する ShapeCollection オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.ShapeData

を呼び出 shape.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.ShapeFillData

を呼び出 shapeFill.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.ShapeFillUpdateData

で使用 shapeFill.set({ ... })する ShapeFill オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.ShapeFontData

を呼び出 shapeFont.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.ShapeFontUpdateData

で使用 shapeFont.set({ ... })する ShapeFont オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.ShapeLineFormatData

を呼び出 shapeLineFormat.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.ShapeLineFormatUpdateData

で使用 shapeLineFormat.set({ ... })する ShapeLineFormat オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.ShapeScopedCollectionData

を呼び出 shapeScopedCollection.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.ShapeScopedCollectionUpdateData

で使用 shapeScopedCollection.set({ ... })する ShapeScopedCollection オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.ShapeUpdateData

で使用 shape.set({ ... })する Shape オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.SlideCollectionData

を呼び出 slideCollection.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.SlideCollectionUpdateData

で使用 slideCollection.set({ ... })する SlideCollection オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.SlideData

を呼び出 slide.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.SlideLayoutCollectionData

を呼び出 slideLayoutCollection.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.SlideLayoutCollectionUpdateData

で使用 slideLayoutCollection.set({ ... })する SlideLayoutCollection オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.SlideLayoutData

を呼び出 slideLayout.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.SlideMasterCollectionData

を呼び出 slideMasterCollection.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.SlideMasterCollectionUpdateData

で使用 slideMasterCollection.set({ ... })する SlideMasterCollection オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.SlideMasterData

を呼び出 slideMaster.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.SlideScopedCollectionData

を呼び出 slideScopedCollection.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.SlideScopedCollectionUpdateData

で使用 slideScopedCollection.set({ ... })する SlideScopedCollection オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.TagCollectionData

を呼び出 tagCollection.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.TagCollectionUpdateData

で使用 tagCollection.set({ ... })する TagCollection オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.TagData

を呼び出 tag.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.TagUpdateData

で使用 tag.set({ ... })する Tag オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.TextFrameData

を呼び出 textFrame.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.TextFrameUpdateData

で使用 textFrame.set({ ... })する TextFrame オブジェクトのデータを更新するためのインターフェイス。

PowerPoint.Interfaces.TextRangeData

を呼び出 textRange.toJSON()して返されるデータを記述するインターフェイス。

PowerPoint.Interfaces.TextRangeUpdateData

で使用 textRange.set({ ... })する TextRange オブジェクトのデータを更新するためのインターフェイス。

列挙型

PowerPoint.ErrorCodes

機能

PowerPoint.createPresentation(base64File)

新しいプレゼンテーションを作成して開きます。 必要に応じて、プレゼンテーションに base64 でエンコードされた.pptx ファイルを事前に設定できます。

[ API set: PowerPointApi 1.1 ]

PowerPoint.run(batch)

新しい RequestContext を使用して、PowerPoint オブジェクト モデルに対してアクションを実行するバッチ スクリプトを実行します。 promise が解決されると、実行中に自動的に割り当てられた追跡対象オブジェクトが解放されます。

PowerPoint.run(object, batch)

以前に作成した API オブジェクトの RequestContext を使用して、PowerPoint オブジェクト モデルに対してアクションを実行するバッチ スクリプトを実行します。 promise が解決されると、実行中に自動的に割り当てられた追跡対象オブジェクトが解放されます。

PowerPoint.run(objects, batch)

以前に作成した API オブジェクトの RequestContext を使用して、PowerPoint オブジェクト モデルに対してアクションを実行するバッチ スクリプトを実行します。

関数の詳細

PowerPoint.createPresentation(base64File)

新しいプレゼンテーションを作成して開きます。 必要に応じて、プレゼンテーションに base64 でエンコードされた.pptx ファイルを事前に設定できます。

[ API set: PowerPointApi 1.1 ]

export function createPresentation(base64File?: string): Promise<void>;

パラメーター

base64File

string

オプション。 base64 でエンコードされた.pptx ファイル。 既定値は null です。

戻り値

Promise<void>

const myFile = <HTMLInputElement>document.getElementById("file");
const reader = new FileReader();

reader.onload = (event) => {
  // Remove the metadata before the base64-encoded string.
  const startIndex = reader.result.toString().indexOf("base64,");
  const copyBase64 = reader.result.toString().substr(startIndex + 7);

  PowerPoint.createPresentation(copyBase64);
};

// Read in the file as a data URL so we can parse the base64-encoded string.
reader.readAsDataURL(myFile.files[0]);

PowerPoint.run(batch)

新しい RequestContext を使用して、PowerPoint オブジェクト モデルに対してアクションを実行するバッチ スクリプトを実行します。 promise が解決されると、実行中に自動的に割り当てられた追跡対象オブジェクトが解放されます。

export function run<T>(batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;

パラメーター

batch

(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>

RequestContext を受け取り、promise を返す関数 (通常は "context.sync()" の結果のみ)。 context パラメーターを使用すると、PowerPoint アプリケーションへの要求が容易になります。 Office アドインと PowerPoint アプリケーションは 2 つの異なるプロセスで実行されるため、アドインから PowerPoint オブジェクト モデルにアクセスするには RequestContext が必要です。

戻り値

PowerPoint.run(object, batch)

以前に作成した API オブジェクトの RequestContext を使用して、PowerPoint オブジェクト モデルに対してアクションを実行するバッチ スクリプトを実行します。 promise が解決されると、実行中に自動的に割り当てられた追跡対象オブジェクトが解放されます。

export function run<T>(object: OfficeExtension.ClientObject, batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;

パラメーター

object
OfficeExtension.ClientObject

以前に作成した API オブジェクト。 バッチでは、渡されたオブジェクトと同じ RequestContext が使用されます。つまり、オブジェクトに適用された変更はすべて "context.sync()" によって取得されます。

batch

(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>

RequestContext を受け取り、promise を返す関数 (通常は "context.sync()" の結果のみ)。 context パラメーターを使用すると、PowerPoint アプリケーションへの要求が容易になります。 Office アドインと PowerPoint アプリケーションは 2 つの異なるプロセスで実行されるため、アドインから PowerPoint オブジェクト モデルにアクセスするには RequestContext が必要です。

戻り値

PowerPoint.run(objects, batch)

以前に作成した API オブジェクトの RequestContext を使用して、PowerPoint オブジェクト モデルに対してアクションを実行するバッチ スクリプトを実行します。

export function run<T>(objects: OfficeExtension.ClientObject[], batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;

パラメーター

objects

OfficeExtension.ClientObject[]

以前に作成した API オブジェクトの配列。 配列は、すべてのオブジェクトが同じコンテキストを共有することを確認するために検証されます。 バッチでは、この共有 RequestContext が使用されます。これは、これらのオブジェクトに適用された変更が "context.sync()" によって取得されることを意味します。

batch

(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>

RequestContext を受け取り、promise を返す関数 (通常は "context.sync()" の結果のみ)。 context パラメーターを使用すると、PowerPoint アプリケーションへの要求が容易になります。 Office アドインと PowerPoint アプリケーションは 2 つの異なるプロセスで実行されるため、アドインから PowerPoint オブジェクト モデルにアクセスするには RequestContext が必要です。

戻り値