跳到主要内容

GetCustomProperties

Returns the custom properties of the workbook.

Syntax

expression.GetCustomProperties();

expression - A variable that represents a ApiWorkbook class.

Parameters

This method doesn't have any parameters.

Returns

ApiCustomProperties

Example

This example demonstrates how to get ApiCustomProperties object of the workbook

const workbook = Api.GetActiveWorkbook();
const customProps = workbook.GetCustomProperties();
customProps.Add("MyStringProperty", "Hello, Spreadsheet!");
let stringValue = customProps.Get("MyStringProperty");

const worksheet = workbook.GetActiveSheet();
worksheet.GetRange('A1').SetValue(stringValue);