Item Property (Windows Collection)

Microsoft Office InfoPath

A read-only property that returns a reference to the specified Window object from the Windows collection.

expression.Item(ByVal varIndex As Variant) As Window

expression    Required. An expression that returns a reference to the Windows collection.

varIndex Required Variant. An expression that specifies the position of a member of the Windows collection. The argument must be a number from 0 to the value of the collection's count property minus 1.

returns    A reference to a Window object.

Security Level

0: Can be accessed without restrictions.

Remarks

If the value provided for the varIndex argument does not match any existing member of the collection, an error occurs.

After you have set a reference to the Window object that the Item property returns, you can access any of its properties and methods.

Example

In the following example, the Item property of the Windows collection is used to return a reference to a Window object:

var objWindow;
objWindow = Application.Windows.Item(0);

Because the Item property is the default property of the Windows collection, it can also be used as follows:

var objWindow;
objWindow = Application.Windows(0);