GetName
返回当前样式的名称。
语法
expression.GetName();
expression - 表示 ApiStyle 类的变量。
参数
此方法没有任何参数。
返回值
string
示例
读取文档中分配给表格样式的名称。
// How do I find out what a table style is called in a document?
// Display the label attached to the active table style in a document.
let doc = Api.GetDocument();
let tableStyle = doc.GetStyle("Bordered");
tableStyle.SetName("My Custom Style");
let table = Api.CreateTable(2, 2);
table.SetWidth("percent", 100);
table.SetStyle(tableStyle);
doc.Push(table);
let tableStyleName = tableStyle.GetName();
let paragraph = doc.GetElement(0);
paragraph.AddText("Table style name = " + tableStyleName);