Border (object)

<< Click to Display Table of Contents >>

Border (object)

Access paths for paragraph borders:

Application à Documents à Item à Paragraphs à Item à Borders à Item

Application à ActiveDocument à Paragraphs à Item à Borders à Item

Access paths for table borders:

Application à Documents à Item à Tables à Item à Borders à Item

Application à ActiveDocument à Tables à Item à Borders à Item

Access path for table row borders:

Application à Documents à Item à Tables à Item à Rows à Item à Borders à Item

Application à ActiveDocument à Tables à Item à Rows à Item à Borders à Item

Access path for table cell borders:

Application à Documents à Item à Tables à Item à Cell(x, y) à Borders à Item

Application à ActiveDocument à Tables à Item à Cell(x, y) à Borders à Item

Application à Documents à Item à Tables à Item à Rows à Item à Cells à Item à Borders à Item

Application à ActiveDocument à Tables à Item à Rows à Item à Cells à Item à Borders à Item

 1  Description

A Border object represents one individual border line of a paragraph, a table, a table row or a table cell – for example the left, right, top, or bottom line. You can use this object to get or change the line settings (thickness, color, etc.) of a border line.

 2  Access to the object

The individual Border objects can only be accessed via the Borders collection of paragraph, table, table row, or table cell. The parameter you pass to the Borders collection is the number of the border that you would like to access:

tmBorderTop          = -1 ' Top border line

tmBorderLeft         = -2 ' Left border line

tmBorderBottom       = -3 ' Bottom border line

tmBorderRight        = -4 ' Right border line

tmBorderHorizontal   = -5 ' Horizontal grid line (only for tables)

tmBorderVertical     = -6 ' Vertical grid line (only for tables and table rows)

tmBorderBetween      = -7 ' Border line between paragraphs (only for paragraphs)

Some examples:

' Change the left border of the first paragraph

tm.ActiveDocument.Paragraphs(1).Borders(tmBorderLeft).Type = tmLineStyleSingle

 

' Change the top border of the first table

tm.ActiveDocument.Tables(1).Borders(tmBorderTop).Type = tmLineStyleDouble

 

' Change the vertical grid lines of the second row in the first table

tm.ActiveDocument.Tables(1).Rows(2).Borders(tmBorderVertical).Color = smoColorRed

 

' Change the bottom border of the third cell in the second row from the first table

tm.ActiveDocument.Tables(1).Rows(2).Cells(3).Borders(tmBorderBottom).Type = tmLineStyleDouble

 3  Properties, objects, collections and methods

Properties:

Type

Thick1

Thick2

Separation

Color

ColorIndex

 

Objects:

Application Application

Parent Borders

Type (property)

Data type: Long (TmLineStyle)

Gets or sets the type of the border line. The possible values are:

tmLineStyleNone     = 0 ' No border

tmLineStyleSingle   = 1 ' Simple border

tmLineStyleDouble   = 2 ' Double border

Thick1 (property)

Data type: Single

Gets or sets the thickness of the first border line in points (1 point corresponds to 1/72 inches).

Thick2 (property)

Data type: Single

Gets or sets the thickness of the second border line in points (1 point corresponds to 1/72 inches).

This property is used only if the type of the border is set to tmLineStyleDouble.

Separation (property)

Data type: Single

Gets or sets the offset between two border lines in points (1 point corresponds to 1/72 inches).

This property is used only if the type of the border is set to tmLineStyleDouble.

Color (property)

Data type: Long (SmoColor)

Gets or sets the color of the border line(s) as a "BGR" value (Blue-Green-Red triplet). You can either provide an arbitrary value or use one of the pre-defined BGR color constants.

ColorIndex (property)

Data type: Long (SmoColorIndex)

Gets or sets the color of the border line(s) as an index color. "Index colors" are the standard colors of TextMaker, numbered from 0 for black to 15 for light gray. You may use the values shown in the Index colors table.

Note: It is recommended to use the Color property (see above) instead of this one, since it is not limited to the 16 standard colors but enables you to access the entire BGR color palette.

Application (pointer to object)

Data type: Object

Returns the Application object.

Parent (pointer to object)

Data type: Object

Returns the parent object, i.e. Borders.