ViewInfoCollection.Item property (String)

Office 2013 and later

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

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

public abstract ViewInfo this[
	string viewName
] { get; }

Parameters

viewName
Type: System.String

The name of the ViewInfo object to get.

Property value

Type: Microsoft.Office.InfoPath.ViewInfo
A ViewInfo object from the ViewInfoCollection collection that corresponds to the specified name.

ExceptionCondition
ArgumentException

The specified view name doesn't exist, or a a null reference (Nothing in Visual Basic) or empty value was passed.

This member can be accessed without restrictions.

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

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

ViewInfo myView = this.ViewInfos["View2"];
Show: