Edit

Share via


ViewInfosCollection Interface

Definition

Contains a ViewInfoObject object for each view within a Microsoft Office InfoPath form.

public interface class ViewInfosCollection : Microsoft::Office::Interop::InfoPath::ViewInfos
[System.Runtime.InteropServices.Guid("096CD601-0786-11D1-95FA-0080C78EE3BB")]
public interface ViewInfosCollection : Microsoft.Office.Interop.InfoPath.ViewInfos
type ViewInfosCollection = interface
    interface ViewInfos
Public Interface ViewInfosCollection
Implements ViewInfos
Derived
Attributes
Implements

Examples

In the following example, implemented as an OnClick event handler for a button on a form, the ViewInfos property of the XDocument object is used to set a reference to the ViewInfos collection. The code then loops through the collection and displays the positional index and name of each ViewInfo object that it contains.

public void ShowViewNames_OnClick(DocActionEvent e)
{
 // Set a reference to the ViewInfos collection.
 ViewInfos viewInfos= thisXDocument.<span class="label">ViewInfos</span>;

 // Loop through the collection and display the name
 // of each ViewInfo object that it contains.
 for (int i=0; i &lt; viewInfos.Count; i++)
 {
  thisXDocument.UI.Alert("View name " + i + ": " + 
   viewInfos[i].Name);
 }
}

Remarks

This type is a wrapper for a COM interface implemented by a coclass that is required by managed code for COM interoperability. To access the members specified by this interface, use the type that wraps the coclass that implements this interface. For information about that type, including usage, remarks, and examples, seeViewInfos.

The ViewInfosCollection collection implements properties that can be used to access a form's associated ViewInfoObject object, and it is accessible through the ViewInfos property of the XDocument object.

The ViewInfosCollection collection can be used only to get the count of the ViewInfoObject objects that it contains or to return a reference to a specified ViewInfoObject object. It cannot be used to create, add, or remove ViewInfoObject objects.

Properties

Count

Gets a count of the number of ViewInfoObject object contained in the ViewInfosCollection collection.

(Inherited from ViewInfos)
Item[Object]

Gets the specified ViewInfoObject object from the ViewInfosCollection collection.

(Inherited from ViewInfos)

Methods

GetEnumerator()

Gets an IEnumerator that iterates over all entries in the ViewInfosCollection object.

(Inherited from ViewInfos)

Applies to