Excel.Line class

ワークシート内の線を表します。 対応する Shape オブジェクトを取得するには、 を使用 Line.shapeします。

Extends

注釈

[ API セット: ExcelApi 1.9 ]

プロパティ

beginArrowheadLength

指定された線の始点の矢印の長さを表します。

beginArrowheadStyle

指定された線の始点の矢印のスタイルを表します。

beginArrowheadWidth

指定された線の始点の矢印の幅を表します。

beginConnectedShape

指定された線の始点が接続されている図形を表します。

beginConnectedSite

コネクタの始点が接続されている結合点を表します。 null線の先頭が図形にアタッチされていない場合にを返します。

connectorType

線のコネクタの種類を表します。

context

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

endArrowheadLength

指定された線の終点の矢印の長さを表します。

endArrowheadStyle

指定された線の終点の矢印のスタイルを表します。

endArrowheadWidth

指定された線の終点の矢印の幅を表します。

endConnectedShape

指定された線の終点が接続されている図形を表します。

endConnectedSite

コネクタの終点が接続されている結合点を表します。 null線の末尾が図形にアタッチされていない場合にを返します。

id

図形識別子を指定します。

isBeginConnected

指定した線の先頭が図形に接続されているかどうかを指定します。

isEndConnected

指定した線の末尾が図形に接続されているかどうかを指定します。

shape

行に Shape 関連付けられているオブジェクトを返します。

メソッド

connectBeginShape(shape, connectionSite)

指定されたコネクタの始点を指定された図形に接続します。

connectEndShape(shape, connectionSite)

指定されたコネクタの終点を指定された図形に接続します。

disconnectBeginShape()

指定されたコネクタの始点を図形から切り離します。

disconnectEndShape()

指定されたコネクタの終点を図形から切り離します。

load(options)

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

load(propertyNames)

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

load(propertyNamesAndPaths)

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

set(properties, options)

オブジェクトの複数のプロパティを同時に設定します。 適切なプロパティを持つプレーン オブジェクトまたは同じ型の別の API オブジェクトを渡すことができます。

set(properties)

既存の読み込まれたオブジェクトに基づいて、オブジェクトに複数のプロパティを同時に設定します。

toJSON()

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

プロパティの詳細

beginArrowheadLength

指定された線の始点の矢印の長さを表します。

beginArrowheadLength: Excel.ArrowheadLength | "Short" | "Medium" | "Long";

プロパティ値

Excel.ArrowheadLength | "Short" | "Medium" | "Long"

注釈

[ API セット: ExcelApi 1.9 ]

beginArrowheadStyle

指定された線の始点の矢印のスタイルを表します。

beginArrowheadStyle: Excel.ArrowheadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open";

プロパティ値

Excel.ArrowheadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open"

注釈

[ API セット: ExcelApi 1.9 ]

beginArrowheadWidth

指定された線の始点の矢印の幅を表します。

beginArrowheadWidth: Excel.ArrowheadWidth | "Narrow" | "Medium" | "Wide";

プロパティ値

Excel.ArrowheadWidth | "Narrow" | "Medium" | "Wide"

注釈

[ API セット: ExcelApi 1.9 ]

beginConnectedShape

指定された線の始点が接続されている図形を表します。

readonly beginConnectedShape: Excel.Shape;

プロパティ値

注釈

[ API セット: ExcelApi 1.9 ]

beginConnectedSite

コネクタの始点が接続されている結合点を表します。 null線の先頭が図形にアタッチされていない場合にを返します。

readonly beginConnectedSite: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.9 ]

connectorType

線のコネクタの種類を表します。

connectorType: Excel.ConnectorType | "Straight" | "Elbow" | "Curve";

プロパティ値

Excel.ConnectorType | "Straight" | "Elbow" | "Curve"

注釈

[ API セット: ExcelApi 1.9 ]

context

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

context: RequestContext;

プロパティ値

endArrowheadLength

指定された線の終点の矢印の長さを表します。

endArrowheadLength: Excel.ArrowheadLength | "Short" | "Medium" | "Long";

プロパティ値

Excel.ArrowheadLength | "Short" | "Medium" | "Long"

注釈

[ API セット: ExcelApi 1.9 ]

endArrowheadStyle

指定された線の終点の矢印のスタイルを表します。

endArrowheadStyle: Excel.ArrowheadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open";

プロパティ値

Excel.ArrowheadStyle | "None" | "Triangle" | "Stealth" | "Diamond" | "Oval" | "Open"

注釈

[ API セット: ExcelApi 1.9 ]

endArrowheadWidth

指定された線の終点の矢印の幅を表します。

endArrowheadWidth: Excel.ArrowheadWidth | "Narrow" | "Medium" | "Wide";

プロパティ値

Excel.ArrowheadWidth | "Narrow" | "Medium" | "Wide"

注釈

[ API セット: ExcelApi 1.9 ]

endConnectedShape

指定された線の終点が接続されている図形を表します。

readonly endConnectedShape: Excel.Shape;

プロパティ値

注釈

[ API セット: ExcelApi 1.9 ]

endConnectedSite

コネクタの終点が接続されている結合点を表します。 null線の末尾が図形にアタッチされていない場合にを返します。

readonly endConnectedSite: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.9 ]

id

図形識別子を指定します。

readonly id: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.9 ]

isBeginConnected

指定した線の先頭が図形に接続されているかどうかを指定します。

readonly isBeginConnected: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.9 ]

isEndConnected

指定した線の末尾が図形に接続されているかどうかを指定します。

readonly isEndConnected: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.9 ]

shape

行に Shape 関連付けられているオブジェクトを返します。

readonly shape: Excel.Shape;

プロパティ値

注釈

[ API セット: ExcelApi 1.9 ]

メソッドの詳細

connectBeginShape(shape, connectionSite)

指定されたコネクタの始点を指定された図形に接続します。

connectBeginShape(shape: Excel.Shape, connectionSite: number): void;

パラメーター

shape
Excel.Shape

接続する図形。

connectionSite

number

コネクタの先頭が接続されている図形上の接続サイト。 0 (包括) から指定した図形の接続サイト数 (排他) の整数である必要があります。

戻り値

void

注釈

[ API セット: ExcelApi 1.9 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/44-shape/shape-lines.yaml

await Excel.run(async (context) => {
    const shapes = context.workbook.worksheets.getItem("Shapes").shapes;
    const line = shapes.getItem("StraightLine").line;
    line.connectBeginShape(shapes.getItem("Left"), 2);
    line.connectEndShape(shapes.getItem("Right"), 0);
    await context.sync();
});

connectEndShape(shape, connectionSite)

指定されたコネクタの終点を指定された図形に接続します。

connectEndShape(shape: Excel.Shape, connectionSite: number): void;

パラメーター

shape
Excel.Shape

接続する図形。

connectionSite

number

コネクタの末尾が接続されている図形上の接続サイト。 0 (包括) から指定した図形の接続サイト数 (排他) の整数である必要があります。

戻り値

void

注釈

[ API セット: ExcelApi 1.9 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/44-shape/shape-lines.yaml

await Excel.run(async (context) => {
    const shapes = context.workbook.worksheets.getItem("Shapes").shapes;
    const line = shapes.getItem("StraightLine").line;
    line.connectBeginShape(shapes.getItem("Left"), 2);
    line.connectEndShape(shapes.getItem("Right"), 0);
    await context.sync();
});

disconnectBeginShape()

指定されたコネクタの始点を図形から切り離します。

disconnectBeginShape(): void;

戻り値

void

注釈

[ API セット: ExcelApi 1.9 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/44-shape/shape-lines.yaml

await Excel.run(async (context) => {
    const shapes = context.workbook.worksheets.getItem("Shapes").shapes;
    const line = shapes.getItem("StraightLine").line;
    line.disconnectBeginShape();
    line.disconnectEndShape();
    await context.sync();
});

disconnectEndShape()

指定されたコネクタの終点を図形から切り離します。

disconnectEndShape(): void;

戻り値

void

注釈

[ API セット: ExcelApi 1.9 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/44-shape/shape-lines.yaml

await Excel.run(async (context) => {
    const shapes = context.workbook.worksheets.getItem("Shapes").shapes;
    const line = shapes.getItem("StraightLine").line;
    line.disconnectBeginShape();
    line.disconnectEndShape();
    await context.sync();
});

load(options)

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

load(options?: Excel.Interfaces.LineLoadOptions): Excel.Line;

パラメーター

options
Excel.Interfaces.LineLoadOptions

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

戻り値

load(propertyNames)

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

load(propertyNames?: string | string[]): Excel.Line;

パラメーター

propertyNames

string | string[]

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

戻り値

load(propertyNamesAndPaths)

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

load(propertyNamesAndPaths?: {
            select?: string;
            expand?: string;
        }): Excel.Line;

パラメーター

propertyNamesAndPaths

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

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

戻り値

set(properties, options)

オブジェクトの複数のプロパティを同時に設定します。 適切なプロパティを持つプレーン オブジェクトまたは同じ型の別の API オブジェクトを渡すことができます。

set(properties: Interfaces.LineUpdateData, options?: OfficeExtension.UpdateOptions): void;

パラメーター

properties
Excel.Interfaces.LineUpdateData

メソッドが呼び出されるオブジェクトのプロパティに等形的に構造化されたプロパティを持つ JavaScript オブジェクト。

options
OfficeExtension.UpdateOptions

properties オブジェクトが読み取り専用プロパティを設定しようとした場合にエラーを抑制するオプションを提供します。

戻り値

void

set(properties)

既存の読み込まれたオブジェクトに基づいて、オブジェクトに複数のプロパティを同時に設定します。

set(properties: Excel.Line): void;

パラメーター

properties
Excel.Line

戻り値

void

toJSON()

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

toJSON(): Excel.Interfaces.LineData;

戻り値