Share via


Application.ViewApply Method

Project Developer Reference

Sets the view in the active window.

Syntax

expression.ViewApply(Name, SinglePane, Toggle)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
Name Optional String The name of the view to display in the active window.
SinglePane Optional Boolean True if any existing split is removed and the active window displays a single-pane view. The default value is False.
Toggle Optional Boolean True if the active window switches from one pane to two panes, or from two panes to one pane. Toggle is ignored if SinglePane is True. The default value is False.

Return Value
Boolean

Example

The following example sets the active window to a single-pane view of the Resource Sheet. It assumes that the active view is a combination of the Gantt Chart and the Task Form.

Visual Basic for Applications
  Sub ChangeWindowToResourceSheet()
    ViewApply Name:="Resource Sheet", SinglePane:=True
End Sub

See Also