Share via


View2.SwitchView Method (String)

Changes the active view of a Microsoft InfoPath form to a specified view.

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

Syntax

'Declaration
Sub SwitchView ( _
    bstrName As String _
)
'Usage
Dim instance As View2
Dim bstrName As String

instance.SwitchView(bstrName)
void SwitchView(
    string bstrName
)

Parameters

  • bstrName
    Type: System.String

    The name of the view to switch to. If an empty string is used, the default view is displayed.

Implements

View.SwitchView(String)

Remarks

If an empty string is used as the bstrName parameter, the view is changed to the default view of the form.

Examples

In the following example, the SwitchView method of the ViewObject object is used to change the current view to the default view:

thisXDocument.View.SwitchView("");

See Also

Reference

View2 Interface

View2 Members

SwitchView Overload

Microsoft.Office.Interop.InfoPath Namespace