Excel.CellPropertiesLoadOptions interface
表示在用作“range.getCellProperties”方法的一部分时要加载的单元格属性。
属性
| address | 指定是否在属性上 |
| address |
指定是否在属性上 |
| format | 指定是否在属性上 |
| hidden | 指定是否在属性上 |
| hyperlink | 指定是否在属性上 |
| style | 指定是否在属性上 |
| text |
指定是否在属性上 |
属性详细信息
address
指定是否在属性上 address 加载。
address?: boolean;
属性值
boolean
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/42-range/cell-properties.yaml
await Excel.run(async (context) => {
const cell = context.workbook.getActiveCell();
// Get only the properties requested in this load-options object.
const propertiesToGet: Excel.CellPropertiesLoadOptions = {
address: true,
format: {
fill: {
color: true
},
font: {
bold: true,
color: true
}
},
style: true
};
const cellProperties = cell.getCellProperties(propertiesToGet);
await context.sync();
const activeCellProperties: Excel.CellProperties = cellProperties.value[0][0];
console.log(JSON.stringify(activeCellProperties, null, 2));
});
addressLocal
format
指定是否在属性上 format 加载。
format?: Excel.CellPropertiesFormatLoadOptions;