SetName
Set the name of the current style.
Parameters:
Name |
Type |
Description |
sStyleName |
string
|
The name which will be used for the current style. |
Example
Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oTableStyle = oDocument.GetStyle("Bordered - Accent 5");
oTableStyle.SetName("My Custom Style");
oTable = Api.CreateTable(2, 2);
oTable.SetWidth("percent", 100);
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
builder.SaveFile("docx", "SetName.docx");
builder.CloseFile();
Resulting document