Edit

Share via


_Explorer.CurrentView Property

Definition

Returns or sets an Object representing the current view. Read/write.

public:
 property System::Object ^ CurrentView { System::Object ^ get(); void set(System::Object ^ value); };
public object CurrentView { get; set; }
Public Property CurrentView As Object

Property Value

Remarks

To obtain a View object for the view of the current Explorer, use Explorer.CurrentView instead of the CurrentView property of the current Folder object returned by CurrentFolder.

You must save a reference to the View object returned by CurrentView before you proceed to use it for any purpose.

To properly reset the current view, you must do a Reset() and then a 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
private void ResetView()
{
    // Save a reference to the current view object    
    Outlook.View v = Application.ActiveExplorer().CurrentView 
        as Outlook.View; 

    // Reset and then apply the current view
    v.Reset();
    v.Apply();
}

When this property is set, two events occur: BeforeViewSwitch occurs before the actual view change takes place and can be used to cancel the change and ViewSwitch takes place after the change is effective.

Applies to