API operations that are related to the Border object of table documents
Border
Range.Borders.Item()
Returns a single border object.
Syntax
expression.Range.Borders.Item(Index)expression: an application object.
Parameters
Name
Data type
Required
Description
Index
Enum
Yes
The border to be retrieved. For more information, see XlBordersIndex.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the Range object. const range = await app.Range('A1'); // Obtain all borders in the range. const borders = await range.Borders; // Obtain a single border object. const border = await borders.Item(1); }
Properties
Range.Borders.Item(Index).Color
Returns the color of a border.
To obtain the color of a border, you must specify a specific border. The enumeration value of Enum.XlBordersIndex cannot be xlOutside or xlInside.
Syntax
expression.Range.Borders.Item(Index).Colorexpression: an application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the Range object. const range = await app.Range('A1'); // Obtain all borders in the range. const borders = await range.Borders; // Obtain a single border object. const border = await borders.Item(app.Enum.XlBordersIndex.xlEdgeLeft); // Obtain the border color. const color = await border.Color; console.log(color); }
Range.Borders.Item(Index).LineStyle
Sets the line style of a border. For more information, see XlLineStyle.
Syntax
expression.Range.Borders.Item(Index).LineStyleexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the Range object. const range = await app.Range('A1'); // Obtain all borders in the range. const borders = await range.Borders; // Obtain a single border object. const border = await borders.Item(app.Enum.XlBordersIndex.xlEdgeLeft); // Specify the line style of the border. border.LineStyle = app.Enum.XlLineStyle.xlDash; }
Range.Borders.Item(Index).Weight
Sets the weight of a border. For more information, see XlBorderWeight.
Syntax
expression.Range.Borders.Item(Index).Weightexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the Range object. const range = await app.Range('A1'); // Obtain all borders in the range. const borders = await range.Borders; // Obtain a single border object. const border = await borders.Item(app.Enum.XlBordersIndex.xlEdgeLeft); // Set the weight of the border. border.Weight = app.Enum.XlBorderWeight.xlThick; }
Borders
Range.Borders
Returns all the borders in a range.
Syntax
expression.Range.Bordersexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the Range object. const range = await app.Range('A1'); // Obtain all borders in the range. const borders = await range.Borders; }