Skip to content

Latest commit

 

History

History
102 lines (74 loc) · 2.2 KB

nameditemcollection.md

File metadata and controls

102 lines (74 loc) · 2.2 KB

NamedItemCollection

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.

Relationships

None

Methods

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.

API Specification

getItem(name: string)

Gets a nameditem object using its name

Syntax

namedItemCollectionObject.getItem(name);

Parameters

Parameter Type Description
name string nameditem name.

Returns

NamedItem

Examples

var ctx = new Excel.RequestContext();
var nameditem = ctx.workbook.names.getItem(wSheetName);
ctx.executeAsync().then(function () {
		Console.log(nameditem.type);
});

Back

load(param: object)

Fills the proxy object created in JavaScript layer with property and object values specified in the parameter.

Syntax

object.load(param);

Parameters

Parameter Type Description
param object Optional. Accepts parameter and relationship names as delimited string or an array. Or, provide loadOption object.

Returns

void

Examples

Back

Getter Examples

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);
});

Back