Skip to main content

SetLeftBorder

Specifies the border which will be displayed at the left side of the page around the specified paragraph.

Syntax​

expression.SetLeftBorder(sType, nSize, nSpace, r, g, b);

expression - A variable that represents an ApiParaPr class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
sTypeRequiredBorderTypeThe border style.
nSizeRequiredpt_8The width of the current left border measured in eighths of a point.
nSpaceRequiredptThe spacing offset to the left of the paragraph measured in points used to place this border.
rRequiredbyteRed color component value.
gRequiredbyteGreen color component value.
bRequiredbyteBlue color component value.

Returns​

boolean

Example​

Add a border to the left side of a paragraph in a document.

// How do I place a visible border on the left edge of a paragraph in a document?

// Decorate a paragraph with a colored left-side border to make it stand out visually.

let doc = Api.GetDocument();
let myStyle = doc.CreateStyle("My document style");
let paraPr = myStyle.GetParaPr();
paraPr.SetLeftBorder("single", 24, 0, 255, 111, 61);
let paragraph = doc.GetElement(0);
paragraph.SetStyle(myStyle);
paragraph.AddText("This is the first paragraph. ");
paragraph.AddText("The paragraph properties styled above set a border at its left side.");