Search.GetTable Method
Obtains a Table object that contains items filtered by the Filter parameter in a preceding _Application.AdvancedSearch method call.
Namespace: Microsoft.Office.Interop.Outlook
Assembly: Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)
Syntax
'Declaration
<DispIdAttribute()> _
Function GetTable As Table
'Usage
Dim instance As Search
Dim returnValue As Table
returnValue = instance.GetTable()
[DispIdAttribute()]
Table GetTable()
Return Value
Type: Microsoft.Office.Interop.Outlook.Table
A Table that contains items that meet the criteria specified by the Filter parameter in a preceding Application.AdvancedSearch method call.
Remarks
Unlike MAPIFolder.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.