Skip to main content

SetRightBorder

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

Syntax​

expression.SetRightBorder(type, size, space, color);

expression - A variable that represents an ApiParaPr class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
typeRequiredBorderTypeThe border style.
sizeRequiredpt_8The width of the current right border measured in eighths of a point.
spaceRequiredptThe spacing offset to the right of the paragraph measured in points used to place this border.
colorRequiredApiColorThe border color.

Returns​

boolean

Example​

Add a border to the right side of a paragraph using the paragraph properties of a style in a document.

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

// Highlight a paragraph by drawing a colored line along its right margin.

let doc = Api.GetDocument();
let myStyle = doc.CreateStyle("My document style");
let paraPr = myStyle.GetParaPr();
paraPr.SetRightBorder("single", 24, 0, Api.Color(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 right side.");