ViewInfoCollection.Item Property (Int32)

Gets the specified ViewInfo object from the ViewInfoCollection collection by index value.

Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in



The zero-based index of the ViewInfo object to get.

Property Value

A ViewInfo object from the ViewInfoCollection collection that corresponds to the specified index value.

Exception typeCondition


The specified index is out of range.

The value passed for the index parameter must be a number from 0 to the value of the collection's Count property minus 1.

This member can be accessed without restrictions.

This type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser.

The following example sets a variable to the ViewInfo object that represents the first view in the collection.

ViewInfo firstView = this.ViewInfos[0];

Community Additions