Search.GetTable Method (Outlook)

Obtains a Table object that contains items filtered by the Filter parameter in a preceding Application.AdvancedSearch method call.

Version Information

Version Added: Outlook 2007

Syntax

expression .GetTable

expression A variable that represents a Search object.

Return Value

A Table that contains items that meet the criteria specified by the Filter parameter in a preceding Application.AdvancedSearch method call.

Remarks

Unlike Folder.GetTable, Search.GetTable does not accept a Filter parameter. The filter for the Table is determined by Search.Filter. Since Search.Filter is a read-only property, the Filter parameter for the Application.AdvancedSearch method establishes the filter for the Table object returned by Search.GetTable.

The Filter parameter supplied to Application.AdvancedSearch must be a DASL query. The filter for AdvancedSearch will not accept a JET query. Do not prefix a DASL query for AdvancedSearch with “@SQL=”. If you add the “@SQL=” prefix, your query will raise an error. For more information on filters, see Filtering Items.

Search.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. For more information on default column sets, see Default Properties Displayed in a Table Object.

Unlike Folder.GetTable, you cannot use Table.Restrict to apply subsequent filters to a Table that is based on the Search object. Specify a new filter in Application.AdvancedSearch to re-apply a filter.

See Also

Concepts

Search Object Members

Search Object