All Products
Search
Document Center

Intelligent Media Management:Border

Last Updated:Apr 30, 2025

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.

Important

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).Color

    expression: 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).LineStyle

    expression: 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).Weight

    expression: 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.Borders

    expression: 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;
    }