Windows Property

Microsoft Office InfoPath

A read-only property that returns a reference to the Windows collection.

expression.Windows

expression    Required. An expression that returns a reference to the Application object.

Security Level

0: Can be accessed without restrictions.

Remarks

After you have set a reference to the Windows collection, you can use its properties to access each of the Window objects that it contains.

Note  The Windows collection can be used only to get the count of the Window objects that it contains or to return a reference to a Window object. It cannot be used to add or remove Window objects.

Example

In the following example, the Windows property is used to access the Count property of the Windows collection and display the value in a message box:

XDocument.UI.Alert("Count of Windows: " + Application.Windows.Count);