共用方式為


MAPIFolder.CurrentView Property

Returns a View object representing the current view. Read-only.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
ReadOnly Property CurrentView As View
    Get
'Usage
Dim instance As MAPIFolder
Dim value As View

value = instance.CurrentView
[DispIdAttribute()]
View CurrentView { get; }

Property Value

Type: Microsoft.Office.Interop.Outlook.View

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 _Explorer.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 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
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();
}

See Also

Reference

MAPIFolder Interface

MAPIFolder Members

Microsoft.Office.Interop.Outlook Namespace

Other Resources

How to: Enumerate Items in a Table View

How to: Select a Folder and Display Folder Information