<< Click to Display Table of Contents >> Windows (collection) |
Access path: Application à Windows
1 Description
The Windows collection contains all open document windows. The individual elements of this collection are of the type Window.
2 Access to the collection
There is exactly one instance of the Windows collection during the whole runtime of PlanMaker. It is accessed through Application.Windows:
' Show the number of open document windows
MsgBox pm.Application.Windows.Count
' Show the name of the first open document window
MsgBox pm.Application.Windows(1).Name
3 Properties, objects, collections and methods
Properties:
▪Count R/O
Objects:
▪Item → Window (default object)
▪Application → Application
▪Parent → Application
Count (property, R/O)
Data type: Long
Returns the number of Window objects in PlanMaker – in other words: the number of open document windows
Item (pointer to object)
Data type: Object
Returns an individual Window object, i.e. an individual document window.
Which Window object you get depends on the parameter that you pass to Item. You can specify either the numeric index or the name of the desired document window. Examples:
' Show the name of the first document window
MsgBox pm.Application.Windows.Item(1).FullName
' Show the name of the document window "Test.tmdx" (if currently open)
MsgBox pm.Application.Windows.Item("Test.pmdx").FullName
' You can also use the full name with path
MsgBox pm.Application.Windows.Item("c:\Documents\Test.pmdx").FullName
Application (pointer to object)
Returns the Application object.
Parent (pointer to object)
Returns the parent object, i.e. Application.