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" |
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
Office Add-ins