Excel.KeyboardDirection enum
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/42-range/range-get-range-edge.yaml
await Excel.run(async (context) => {
// Get the selected range.
const range = context.workbook.getSelectedRange();
// Specify the direction with the `KeyboardDirection` enum.
const direction = Excel.KeyboardDirection.up;
// Get the active cell in the workbook.
const activeCell = context.workbook.getActiveCell();
// Get the top-most cell of the current used range.
// This method acts like the Ctrl+Arrow key keyboard shortcut while a range is selected.
const rangeEdge = range.getRangeEdge(
direction,
activeCell // If the selected range contains more than one cell, the active cell must be defined.
);
rangeEdge.select();
await context.sync();
});
字段
down = "Down" | |
left = "Left" | |
right = "Right" | |
up = "Up" |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈