# SwitchView Method

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

expression.SwitchView(ByVal bstrName As String)

expression Required. An expression that returns a reference to the View object.

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

## Security Level

2: 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.

## Remarks

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

## Example

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

    XDocument.View.SwitchView("");

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp