Skip to main content

Row

Row

JSSDK: 1.2.0、zOffice2022.3 支持

表格行。

属性

range

JSSDK: 1.7.1、zOffice V7.2 FP1 支持

获取表格行范围

语法

Row.range

Row: 表格行对象

返回值

Promise<Word.Range>

示例

async function example() {
const table = await Application.ActiveDocument.Tables.item(1);
const row = await table.Rows.item(1);
const range = await row.range;
}

Cells

JSSDK: 1.3.0、zOffice V6 支持

返回一个 Cells集合,该集合代表表格行中的所有单元格。

语法

row.Cells

row:表格行对象

返回值

Promise< Word.Cells>

示例

async function example() {
const table = await Application.ActiveDocument.Tables.item(1);
const row = await table.Rows.item(1);
const Cells = row.Cells;
}

index

JSSDK: 1.3.0、zOffice V6 支持

行号。

语法

row.index

row:表格行对象

返回值

Promise< number>

示例

async function example() {
const table = await Application.ActiveDocument.Tables.item(1);
const row = await table.Rows.item(1);
const index = await row.index;
}

方法

delete

JSSDK: 1.3.0、zOffice V6 支持

删除行。

语法

row.delete()

row: 行对象

返回值

Promise<boolean> 是否删除成功

示例

async function example() {
const table = await Application.ActiveDocument.Tables.item(1);
const row = await table.Rows.item(1);
const result = await row.delete();
}