Excel.WorksheetSingleClickedEventArgs interface

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

提供有关引发了左键单击或点击过的事件的工作表的信息。Provides information about the worksheet that raised the left-clicked/tapped event.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

属性

address

获取特定工作表中表示被左键单击/点击的单元格的地址。Gets the address that represents the cell which was left-clicked/tapped for a specific worksheet.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

offsetX

从左键单击/点击的点到左键单击/点击的单元格的左(RTL 则为右侧)网格线边缘的距离(以磅为单位)。The distance, in points, from the left-clicked/tapped point to the left (right for RTL) gridline edge of the left-clicked/tapped cell.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

offsetY

从左键单击/点击的点到左键单击/点击的单元格的顶部网格线边缘的距离(以磅为单位)。The distance, in points, from the left-clicked/tapped point to the top gridline edge of the left-clicked/tapped cell.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

type

获取事件的类型。Gets the type of the event.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

worksheetId

获取已在其中左键单击/点击单元格的工作表的 ID。Gets the id of the worksheet in which the cell was left-clicked/tapped.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

属性详细信息

address

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

获取特定工作表中表示被左键单击/点击的单元格的地址。Gets the address that represents the cell which was left-clicked/tapped for a specific worksheet.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

address: string;

属性值

string

示例Examples

await Excel.run(async (context) => {
    const sheet = context.workbook.worksheets.getActiveWorksheet();
    sheet.onSingleClicked.add((event) => {
        return Excel.run((context) => {
            console.log(`Click detected at ${event.address} (pixel offset from upper-left cell corner: ${event.offsetX}, ${event.offsetY})`);
            return context.sync();
        });
    });

    console.log("The worksheet click handler is registered.");

    await context.sync();
});

offsetX

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

从左键单击/点击的点到左键单击/点击的单元格的左(RTL 则为右侧)网格线边缘的距离(以磅为单位)。The distance, in points, from the left-clicked/tapped point to the left (right for RTL) gridline edge of the left-clicked/tapped cell.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

offsetX: number;

属性值

number

offsetY

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

从左键单击/点击的点到左键单击/点击的单元格的顶部网格线边缘的距离(以磅为单位)。The distance, in points, from the left-clicked/tapped point to the top gridline edge of the left-clicked/tapped cell.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

offsetY: number;

属性值

number

type

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

获取事件的类型。Gets the type of the event.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

type: "WorksheetSingleClicked";

属性值

"WorksheetSingleClicked"

worksheetId

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

获取已在其中左键单击/点击单元格的工作表的 ID。Gets the id of the worksheet in which the cell was left-clicked/tapped.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

worksheetId: string;

属性值

string