共用方式為


MAPIFolder.GetTable Method

Obtains a Table object that contains items filtered by Filter.

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

Syntax

'Declaration
<DispIdAttribute()> _
Function GetTable ( _
    Filter As Object, _
    TableContents As Object _
) As Table
'Usage
Dim instance As MAPIFolder
Dim Filter As Object
Dim TableContents As Object
Dim returnValue As Table

returnValue = instance.GetTable(Filter, _
    TableContents)
[DispIdAttribute()]
Table GetTable(
    Object Filter,
    Object TableContents
)

Parameters

  • Filter
    Type: System.Object

    A filter in Microsoft Jet or DAV Searching and Locating (DASL) syntax that specifies the criteria for items in the parent Folder.

  • TableContents
    Type: System.Object

    Specifies the type of items in the folder that GetTable returns. The default is olUserItems.

Return Value

Type: Microsoft.Office.Interop.Outlook.Table
A Table that contains items in the parent Folder that meet the criteria in Filter. By default, TableContents is olUserItems and the returned Table contains only the filtered items that are not hidden.

Remarks

If Filter is a blank string or the Filter parameter is omitted, GetTable returns a Table with rows representing all the items in the Folder. If Filter is a blank string or the Filter parameter is omitted and TableContents is olHiddenItems, GetTable returns a Table with rows representing all the hidden items in the Folder.

For more information on filters, see Filtering Items and Referencing Properties by Namespace.

GetTable returns a Table with the default column set for the folder type of the parent Folder. To modify the default column set, use the Add, Remove, or RemoveAll methods of the Columns collection object. When TableContents is olHiddenItems, the default column set is always the default column set for a mail folder even though the parent Folder might be, for example, a Contacts folder. For more information on default column sets, see Default Properties Displayed in a Table Object.

You can use _Table.Restrict to apply subsequent filters to a Table that is based on the Folder object.

See Also

Reference

MAPIFolder Interface

MAPIFolder Members

Microsoft.Office.Interop.Outlook Namespace

Other Resources

How to: Synchronize Outlook with a SharePoint Folder

How to: Filter and Efficiently Enumerate Items in a Folder

How to: Use Arrays to Efficiently Enumerate Items in a Folder

How to: Enumerate Items in the Inbox Based on the Last Modification Time

How to: Filter and Display Multivalued Properties When Enumerating Items in a Folder

How to: Enumerate Hidden Items in a Folder

How to: Search for a Phrase in the Body of Items in a Folder

How to: Search Attachments of Items in a Folder for an Exact Phrase