次の方法で共有


PowerPoint.SlideBackground class

スライドの背景を表します。

Extends

注釈

[ API set: PowerPointApi 1.10 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/slide-management/get-set-background-fill.yaml

// Gets the background fill type of the first selected slide.
await PowerPoint.run(async (context) => {
  const slide: PowerPoint.Slide = context.presentation.getSelectedSlides().getItemAt(0);
  const fill: PowerPoint.SlideBackgroundFill = slide.background.fill;
  fill.load("type");
  await context.sync();

  const fillType = fill.type as PowerPoint.SlideBackgroundFillType;
  console.log(`Background fill type: ${fillType}`);
});

プロパティ

areBackgroundGraphicsHidden

スライド レイアウトの背景の塗りつぶしをスライド マスターから背景グラフィック オブジェクトを非表示にするか表示するかを指定します。

context

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

fill

背景の塗りつぶしの書式設定を返します。

isMasterBackgroundFollowed

スライドの背景がスライド マスターの背景に従うかどうかを指定します。

メソッド

load(options)

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

load(propertyNames)

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

load(propertyNamesAndPaths)

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

reset()

スライドの背景の塗りつぶしの書式設定をリセットします。

toJSON()

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

プロパティの詳細

areBackgroundGraphicsHidden

スライド レイアウトの背景の塗りつぶしをスライド マスターから背景グラフィック オブジェクトを非表示にするか表示するかを指定します。

areBackgroundGraphicsHidden: boolean;

プロパティ値

boolean

注釈

[ API set: PowerPointApi 1.10 ]

context

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

context: RequestContext;

プロパティ値

fill

背景の塗りつぶしの書式設定を返します。

readonly fill: PowerPoint.SlideBackgroundFill;

プロパティ値

注釈

[ API set: PowerPointApi 1.10 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/slide-management/get-set-background-fill.yaml

// Gets the background fill type of the first selected slide.
await PowerPoint.run(async (context) => {
  const slide: PowerPoint.Slide = context.presentation.getSelectedSlides().getItemAt(0);
  const fill: PowerPoint.SlideBackgroundFill = slide.background.fill;
  fill.load("type");
  await context.sync();

  const fillType = fill.type as PowerPoint.SlideBackgroundFillType;
  console.log(`Background fill type: ${fillType}`);
});

isMasterBackgroundFollowed

スライドの背景がスライド マスターの背景に従うかどうかを指定します。

isMasterBackgroundFollowed: boolean;

プロパティ値

boolean

注釈

[ API set: PowerPointApi 1.10 ]

メソッドの詳細

load(options)

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

load(options?: PowerPoint.Interfaces.SlideBackgroundLoadOptions): PowerPoint.SlideBackground;

パラメーター

options
PowerPoint.Interfaces.SlideBackgroundLoadOptions

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

返品

load(propertyNames)

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

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

パラメーター

propertyNames

string | string[]

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

返品

load(propertyNamesAndPaths)

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

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

パラメーター

propertyNamesAndPaths

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

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

返品

reset()

スライドの背景の塗りつぶしの書式設定をリセットします。

reset(): void;

返品

void

注釈

[ API set: PowerPointApi 1.10 ]

toJSON()

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

toJSON(): PowerPoint.Interfaces.SlideBackgroundData;

返品