ViewInfoCollection.Item Property (String) (Microsoft.Office.InfoPath)

Gets the specified ViewInfo object from the ViewInfoCollection collection by name.

Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)

Syntax

'Declaration
Public MustOverride ReadOnly Default Property Item ( _
    viewName As String _
) As ViewInfo
'Usage
Dim instance As ViewInfoCollection
Dim viewName As String
Dim value As ViewInfo

value = instance(viewName)
public abstract ViewInfo this [
    string viewName
] { get; }

Parameters

  • viewName
    The name of the ViewInfo object to get.

Property Value

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

Exceptions

Exception type Condition

ArgumentException

The specified view name doesn't exist, or a null or empty value was passed.

Remarks

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.

Example

The following example sets a variable to the ViewInfo object with the name "View2".

ViewInfo myView = this.ViewInfos["View2"];
Dim myView As ViewInfo = Me.ViewInfos("View2")

See Also

Reference

ViewInfoCollection Class
ViewInfoCollection Members
Microsoft.Office.InfoPath Namespace