A collection of all the nameditem objects that are part of the workbook.
Property | Type | Description |
---|---|---|
items | NamedItem[] | A collection of namedItem objects. Read-only. |
None
Method | Return Type | Description |
---|---|---|
getItem(name: string) | NamedItem | Gets a nameditem object using its name |
load(param: object) | void | Fills the proxy object created in JavaScript layer with property and object values specified in the parameter. |
Gets a nameditem object using its name
namedItemCollectionObject.getItem(name);
Parameter | Type | Description |
---|---|---|
name | string | nameditem name. |
var ctx = new Excel.RequestContext();
var nameditem = ctx.workbook.names.getItem(wSheetName);
ctx.executeAsync().then(function () {
Console.log(nameditem.type);
});
Fills the proxy object created in JavaScript layer with property and object values specified in the parameter.
object.load(param);
Parameter | Type | Description |
---|---|---|
param | object | Optional. Accepts parameter and relationship names as delimited string or an array. Or, provide loadOption object. |
void
var ctx = new Excel.RequestContext();
var nameditems = ctx.workbook.names;
ctx.load(nameditems);
ctx.executeAsync().then(function () {
for (var i = 0; i < nameditems.items.length; i++)
{
Console.log(nameditems.items[i].name);
Console.log(nameditems.items[i].index);
}
});
Get the number of nameditems.
var ctx = new Excel.RequestContext();
var nameditems = ctx.workbook.names;
ctx.load(tables);
ctx.executeAsync().then(function () {
Console.log("nameditems: Count= " + nameditems.count);
});