Partager via


View.Apply Method (Outlook)

Applies the view to the Microsoft Outlook user interface.

Syntax

expression .Apply

expression A variable that represents a View object.

Remarks

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 
 

Example

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

See Also

Concepts

View Object

View Object Members