Rediger

Del via


_Table.Restrict(String) Method

Definition

Applies a filter to the rows in the Table and obtains a new Table object.

public:
 Microsoft::Office::Interop::Outlook::Table ^ Restrict(System::String ^ Filter);
public Microsoft.Office.Interop.Outlook.Table Restrict (string Filter);
Public Function Restrict (Filter As String) As Table

Parameters

Filter
String

Specifies the criteria for rows in the Table object.

Returns

A Table object that is returned by applying Filter to the rows in the parent Table object.

Remarks

You can only use Table.Restrict to apply another filter to that Table if the parent object of the Table is a Folder object. If the parent object is a Search object, Restrict will return an error.

Since the filter is applied to the rows in the Table object, this is equivalent to applying a filter that is a logical AND of Filter and all preceding filters applied to the same Table object.

Filter is a query on specified properties of items that are represented as rows in the parent Table. The query uses either the Microsoft Jet syntax or the DAV Searching and Locating (DASL) syntax. For example, the following Jet filter and DASL filter specify the same criteria for items with LastModificationTime earlier than 3:30pm of June 12, 2005:

criteria = "[LastModificationTime] < '" & Format$("6/12/2005 3:30PM","General Date") & "'"

criteria = "@SQL=" & Chr(34) & "DAV:getlastmodified" & Chr(34) & " < '" & Format$("6/12/2005 3:30PM","General Date") & "'"

For more information on specifying filters for the Table object, see Filtering Items

If Filter contains custom properties, those properties must exist in the parent folder of the Table object in order for the restriction to work correctly. Certain properties are not supported in a Table filter, including binary properties, computed properties, and HTML or RTF body content. For more information, see Unsupported Properties in a Table Object or Table Filter

If Filter is a blank string, Restrict returns a Table object that is identical to the parent Table object.

Applies to