View.ViewInfo property

Office 2013 and later

Gets a reference to a ViewInfo object associated with the view.

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

public abstract ViewInfo ViewInfo { get; }

Property value

Type: Microsoft.Office.InfoPath.ViewInfo
A ViewInfo associated with the current view.

The ViewInfo object provides properties that can be used to get the name of a view and determine whether its name is hidden on the View menu.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

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 uses the ViewInfo property of the View class to get the name for the current view.

string myViewName = this.CurrentView.ViewInfo.Name;
Dim myViewName As String = Me.CurrentView.ViewInfo.Name