Excel.CellPropertiesFillLoadOptions interface
指定要在对象上 format.fill 加载的属性。
属性
| color | 指定是否加载 |
| pattern | 指定是否加载 |
| pattern |
指定是否加载 |
| pattern |
指定是否加载 |
| tint |
指定是否加载 |
属性详细信息
color
指定是否加载 color 属性。
color?: 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));
});