GetStyle
Get a style by the style name.
Parameters:
Name |
Type |
Description |
sStyleName |
string
|
The name using which it is possible to address the style. |
Returns:
- Type
-
ApiStyle
Example
Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oNoSpacingStyle = oDocument.GetStyle("Heading 6");
oParagraph = oDocument.GetElement(0);
oParagraph.SetStyle(oNoSpacingStyle);
oParagraph.AddText("This is a text in a paragraph styled with the 'Heading 6' style.");
builder.SaveFile("docx", "ApiDocument.docx");
builder.CloseFile();
Resulting document