Get Started
Usage API
More information


SetLeftBorder(sType, nSize, nSpace, r, g, b)

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


Name Type Description
sType BorderType

The border style.

nSize pt_8

The width of the current left border measured in eighths of a point.

nSpace pt

The spacing offset to the left of the paragraph measured in points used to place this border.

r byte

Red color component value.

g byte

Green color component value.

b byte

Blue color component value.


This method doesn't return any data.


Copy code
var oDocument = Api.GetDocument();
var oMyStyle = oDocument.CreateStyle("My document style");
var oParaPr = oMyStyle.GetParaPr();
oParaPr.SetLeftBorder("single", 24, 0, 255, 111, 61);
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is the first paragraph. ");
oParagraph.AddText("The paragraph properties styled above set a border at its left side.");
builder.SaveFile("docx", "SetLeftBorder.docx");

Resulting document