title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
View.Apply method (Outlook) |
vbaol11.chm2484 |
|
|
b121d1ce-24b7-4ace-8369-42e5c7becd0a |
06/08/2017 |
medium |
Applies the view to the Microsoft Outlook user interface.
expression.Apply
expression A variable that represents a View object.
To properly reset the current view, you must do a View.Reset and then a View.Apply. The code sample below illustrates the order of the calls:
Sub ResetView()
Dim v as Outlook.View
' Save a reference to the current view object
Set v = Application.ActiveExplorer.CurrentView
' Reset and then apply the current view
v.Reset
v.Apply
End Sub
The following Visual Basic for Applications (VBA) example creates a new view called New Table and applies it.
Sub CreateView()
'Creates a new view
Dim objName As Outlook.NameSpace
Dim objViews As Outlook.Views
Dim objNewView As Outlook.View
Set objName = Application.GetNamespace("MAPI")
Set objViews = objName.GetDefaultFolder(olFolderInbox).Views
Set objNewView = objViews.Add(Name:="New Table", _
ViewType:=olTableView)
objNewView.Save
objNewView.Apply
End Sub
[!includeSupport and feedback]