PowerPoint.Presentation class
- Extends
注釈
[ API set: PowerPointApi 1.0 ]
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/slide-management/insert-slides.yaml
await PowerPoint.run(async function(context) {
// Get the ID of the first selected slide.
const presentation = context.presentation;
const selected = presentation.getSelectedSlides().getItemAt(0);
selected.load("id");
await context.sync();
// Insert the other presentation after the selected slide.
const insertOptions: PowerPoint.InsertSlideOptions = {
formatting: PowerPoint.InsertSlideFormatting.useDestinationTheme,
targetSlideId: selected.id
};
presentation.insertSlidesFromBase64(chosenFileBase64, insertOptions);
await context.sync();
});
プロパティ
context | オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。 |
title |
メソッド
load(options) | オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
load(property |
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
load(property |
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
toJSON() | API オブジェクトが |
プロパティの詳細
context
オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。
context: RequestContext;
プロパティ値
title
readonly title: string;
プロパティ値
string
メソッドの詳細
load(options)
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync()
を呼び出す必要があります。
load(options?: PowerPoint.Interfaces.PresentationLoadOptions): PowerPoint.Presentation;
パラメーター
読み込むオブジェクトのプロパティのオプションを提供します。
戻り値
load(propertyNames)
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync()
を呼び出す必要があります。
load(propertyNames?: string | string[]): PowerPoint.Presentation;
パラメーター
- propertyNames
-
string | string[]
読み込むプロパティを指定するコンマ区切り文字列または文字列の配列。
戻り値
load(propertyNamesAndPaths)
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync()
を呼び出す必要があります。
load(propertyNamesAndPaths?: {
select?: string;
expand?: string;
}): PowerPoint.Presentation;
パラメーター
- propertyNamesAndPaths
-
{ select?: string; expand?: string; }
propertyNamesAndPaths.select
は読み込むプロパティを指定するコンマ区切りの文字列で、 propertyNamesAndPaths.expand
は読み込むナビゲーション プロパティを指定するコンマ区切りの文字列です。
戻り値
toJSON()
API オブジェクトがJSON.stringify()
に渡されたときにより便利な出力を提供するために、JavaScript toJSON()
メソッドをオーバーライドします。 (JSON.stringify
、それに渡されるオブジェクトの toJSON
メソッドを呼び出します)。元の PowerPoint.Presentation
オブジェクトは API オブジェクトですが、 toJSON
メソッドは、元のオブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト ( PowerPoint.Interfaces.PresentationData
として型指定) を返します。
toJSON(): PowerPoint.Interfaces.PresentationData;
戻り値
Office Add-ins