跳到主要内容

GetInternalId

返回当前表格的内部 ID。

语法​

expression.GetInternalId();

expression - 表示 ApiTable 类的变量。

参数​

此方法没有任何参数。

返回值​

string

示例​

在演示文稿中获取表格的内部标识符。

// Useful for getting a unique identifier of a table.

// Create a table and display its internal id in the first cell.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
const table = Api.CreateTable(2, 2);
const id = table.GetInternalId();
const cell = table.GetCell(0, 0);
const paragraph = Api.CreateParagraph();
paragraph.AddText("Table id: " + id);
cell.GetContent().Push(paragraph);
slide.RemoveAllObjects();
slide.AddObject(table);