Windows (collection)

<< 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 TextMaker. It is accessed through Application.Windows:

' Show the number of open document windows

MsgBox tm.Application.Windows.Count

 

' Show the name of the first open document window

MsgBox tm.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 TextMaker – 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 tm.Application.Windows.Item(1).FullName

 

' Show the name of the document window "Test.tmdx" (if currently open)

MsgBox tm.Application.Windows.Item("Test.tmdx").FullName

 

' You can also use the full name with path

MsgBox tm.Application.Windows.Item("c:\Documents\Test.tmdx").FullName

Application (pointer to object)

Data type: Object

Returns the Application object.

Parent (pointer to object)

Data type: Object

Returns the parent object, i.e. Application.