Altova StyleVision 2025 Professional Edition

The JScript listing below shows how to iterate through the open documents. It is assumed that you have already started the application and opened some documents as shown in the previous sections.

 

 

// go through all open documents using a JScript Enumerator
for (var iterDocs = new Enumerator(objStyleVision.Documents); !iterDocs.atEnd(); iterDocs.moveNext())
{
  objName = iterDocs.item().Name;
  WScript.Echo("Document name: " + objName);
}
 
// go through all open documents using index-based access to the document collection
for (i = objStyleVision.Documents.Count; i > 0; i--)
  objStyleVision.Documents.Item(i).Close();

 

 

The JScript code listed above is available in the sample file DocumentAccess.js (see Example Files).

© 2018-2024 Altova GmbH