ViewInfoCollection class
Contains a ViewInfo object for each view within a form.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
The ViewInfoCollection class implements properties that can be used to access the ViewInfo object associated with each view in a form. The ViewInfoCollection object for a form is accessed through the ViewInfos property of the XmlForm class.
The ViewInfoCollection object can be used to return a reference to a specified ViewInfo object, get the count of the ViewInfo objects, switch views, and return information about a view. It cannot be used to create, add, or remove ViewInfo objects.
In the following example, the ViewInfos property of the XmlForm class is used to set a reference to the ViewInfoCollection of the form. The code then loops through the collection and uses the HideName property of the ViewInfo class to determine whether the view is hidden from the View menu. If it is, the name of the view is displayed in a message box.