scripting:collections

This is an old revision of the document!


Collection Objects

Collection objects used in different HE API calls and simplify access to object sets.

In general case collection object has following method/properties:

Property Description
Count Returns number of items in collection
Method Description
Item Returns item object by index
var oOutput = Application.Output("Test Output");
var oBookmarks = ActiveDocument.Bookmarks;
 
for (var i = 1; i <= oBookmarks.Count; ++i) {
	var oBookmark = oBookmarks.Item(i)
}
 
	output.writeln( i + " : " + Syntaxes.Item(i).Name + " (" + Syntaxes[i].Description + ")");
pBookmarks = DocumentData.Bookmarks
CComPtr<IBookmarks> pBookmarks;
HRESULT hr = DocumentData.get_Bookmarks(&pBookmarks);