Get Started
Usage API
More information

GetStyle

GetStyle() → { ApiStyle }

Get the paragraph style method.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiStyle

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oHeading6Style = oDocument.GetStyle("Heading 6");
oParagraph = oDocument.GetElement(0);
oParaPr = oParagraph.GetParaPr();
oParaPr.SetJc("center");
oParaPr.SetStyle(oHeading6Style);
oParagraph.AddText("This is a text in a paragraph styled with the 'Heading 6' style.");
oStyle = oParaPr.GetStyle();
oParagraph.AddLineBreak();
oParagraph.AddText("Style: " + oStyle.GetName());
builder.SaveFile("docx", "GetStyle.docx");
builder.CloseFile();

Resulting document