Get Started
Documentation

GetParaPr

GetParaPr() → {ApiParaPr}

Get the set of the paragraph properties which will be applied to all the paragraphs within a table which match the conditional formatting type.

Returns:

Type
ApiParaPr

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oTable, oTableStyle, oTableStylePr, oParaPr;
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("We create a 3x3 table and set the text alignment to center for row #1:");
oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered - Accent 5"));
oTable = Api.CreateTable(3, 3);
oTable.SetWidth("percent", 100);
oTableStylePr = oTableStyle.GetConditionalTableStyle("firstRow");
oTable.SetTableLook(true, true, true, true, true, true);
oParaPr = oTableStylePr.GetParaPr();
oParaPr.SetJc("center");
oParagraph = oTable.GetRow(0).GetCell(0).GetContent().GetElement(0);
oParagraph.AddText("This is a paragraph with the text in it aligned by the center.");
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
builder.SaveFile("docx", "GetParaPr.docx");
builder.CloseFile();

Resulting document