Share via


_XDocument4.ViewInfos property

Gets a reference to the ViewInfosCollection collection associated with a Microsoft InfoPath form.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
ReadOnly Property ViewInfos As ViewInfosCollection
    Get
'Usage
Dim instance As _XDocument4
Dim value As ViewInfosCollection

value = instance.ViewInfos
ViewInfosCollection ViewInfos { get; }

Property value

Type: Microsoft.Office.Interop.InfoPath.ViewInfosCollection

Implements

_XDocument3.ViewInfos

Remarks

The ViewInfos collection contains a collection of ViewInfoObject object containing information about each of the views implemented in an InfoPath form.

Examples

In the following example, the ViewInfos property of the XDocument object is used to set a reference to the ViewInfosCollection collection; then, using the Count property of the ViewInfosCollection collection, it loops through the collection to determine the default view using the IsDefault property of the ViewInfoObject object. When the default view is found, the code displays the name of the view in a message box.

ViewInfos viewInfos;
viewInfos = thisXDocument.ViewInfos;

for (int i=0; i < viewInfos.Count; i++)
{
 if (viewInfos[i].IsDefault)
 {
  thisXDocument.UI.Alert("The default view is: " + viewInfos[i].Name);
 }
}

See also

Reference

_XDocument4 interface

_XDocument4 members

ViewInfos overload

Microsoft.Office.Interop.InfoPath namespace