PowerPoint.ShapeLineFormat class

図形オブジェクトの線の書式設定を表します。 画像や幾何学的図形の場合、線の書式設定は図形の境界を表します。

Extends

注釈

API セット: PowerPointApi 1.4

使用元

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

// Changes the dash style of every line in the slide.
await PowerPoint.run(async (context) => {
  // Get the type of shape for every shape in the collection.
  const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
  shapes.load("type");
  await context.sync();

  // Change the dash style for shapes of the type `line`.
  shapes.items.forEach((shape) => {
    if (shape.type === PowerPoint.ShapeType.line) {
      shape.lineFormat.style = PowerPoint.ShapeLineStyle.thickThin;
      shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
    }
  });
  await context.sync();
});

プロパティ

color

線の色を HTML カラー形式で、#RRGGBB 形式 ("FFA500" など) または名前付き HTML 色 ("オレンジ" など) で表します。

context

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

dashStyle

線の破線スタイルを表します。 線が表示されていない場合、または破線のスタイルに一貫性がない場合は null を返します。 詳細については 、PowerPoint.ShapeLineDashStyle を参照してください。

style

図形の線スタイルを表します。 線が表示されていない場合、またはスタイルに一貫性がない場合は null を返します。 詳細については 、「PowerPoint.ShapeLineStyle 」を参照してください。

transparency

線の透明度の割合を、0.0 (不透明) から 1.0 (クリア) までの値で指定します。 図形の透明度が一定ではない場合は、null を返します。

visible

図形要素の線の書式設定を表示するかどうかを指定します。 図形の表示に一貫性がない場合に null を返します。

weight

線の太さ (ポイント数) を表します。 線が表示されていない場合、または線の太さに一貫性がない場合に null を返します。

メソッド

load(options)

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

load(propertyNames)

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

load(propertyNamesAndPaths)

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

toJSON()

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

プロパティの詳細

color

線の色を HTML カラー形式で、#RRGGBB 形式 ("FFA500" など) または名前付き HTML 色 ("オレンジ" など) で表します。

color: string;

プロパティ値

string

注釈

API セット: PowerPointApi 1.4

context

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

context: RequestContext;

プロパティ値

dashStyle

線の破線スタイルを表します。 線が表示されていない場合、または破線のスタイルに一貫性がない場合は null を返します。 詳細については 、PowerPoint.ShapeLineDashStyle を参照してください。

dashStyle: PowerPoint.ShapeLineDashStyle | "Dash" | "DashDot" | "DashDotDot" | "LongDash" | "LongDashDot" | "RoundDot" | "Solid" | "SquareDot" | "LongDashDotDot" | "SystemDash" | "SystemDot" | "SystemDashDot";

プロパティ値

PowerPoint.ShapeLineDashStyle | "Dash" | "DashDot" | "DashDotDot" | "LongDash" | "LongDashDot" | "RoundDot" | "Solid" | "SquareDot" | "LongDashDotDot" | "SystemDash" | "SystemDot" | "SystemDashDot"

注釈

API セット: PowerPointApi 1.4

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

// Changes the dash style of every line in the slide.
await PowerPoint.run(async (context) => {
  // Get the type of shape for every shape in the collection.
  const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
  shapes.load("type");
  await context.sync();

  // Change the dash style for shapes of the type `line`.
  shapes.items.forEach((shape) => {
    if (shape.type === PowerPoint.ShapeType.line) {
      shape.lineFormat.style = PowerPoint.ShapeLineStyle.thickThin;
      shape.lineFormat.dashStyle = PowerPoint.ShapeLineDashStyle.dashDot;
    }
  });
  await context.sync();
});

style

図形の線スタイルを表します。 線が表示されていない場合、またはスタイルに一貫性がない場合は null を返します。 詳細については 、「PowerPoint.ShapeLineStyle 」を参照してください。

style: PowerPoint.ShapeLineStyle | "Single" | "ThickBetweenThin" | "ThickThin" | "ThinThick" | "ThinThin";

プロパティ値

PowerPoint.ShapeLineStyle | "Single" | "ThickBetweenThin" | "ThickThin" | "ThinThick" | "ThinThin"

注釈

API セット: PowerPointApi 1.4

transparency

線の透明度の割合を、0.0 (不透明) から 1.0 (クリア) までの値で指定します。 図形の透明度が一定ではない場合は、null を返します。

transparency: number;

プロパティ値

number

注釈

API セット: PowerPointApi 1.4

visible

図形要素の線の書式設定を表示するかどうかを指定します。 図形の表示に一貫性がない場合に null を返します。

visible: boolean;

プロパティ値

boolean

注釈

API セット: PowerPointApi 1.4

weight

線の太さ (ポイント数) を表します。 線が表示されていない場合、または線の太さに一貫性がない場合に null を返します。

weight: number;

プロパティ値

number

注釈

API セット: PowerPointApi 1.4

メソッドの詳細

load(options)

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

load(options?: PowerPoint.Interfaces.ShapeLineFormatLoadOptions): PowerPoint.ShapeLineFormat;

パラメーター

options
PowerPoint.Interfaces.ShapeLineFormatLoadOptions

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

返品

load(propertyNames)

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

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

パラメーター

propertyNames

string | string[]

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

返品

load(propertyNamesAndPaths)

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

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

パラメーター

propertyNamesAndPaths

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

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

返品

toJSON()

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

toJSON(): PowerPoint.Interfaces.ShapeLineFormatData;

返品