CalendarView 属性(Outlook)CalendarView.Filter property (Outlook)

返回或设置一个 String 值,该值代表视图的筛选器。Returns or sets a String value that represents the filter for a view. 读/写。Read/write.

语法Syntax

expressionexpression. Filter

_表达式_一个代表CalendarView对象的变量。expression A variable that represents a CalendarView object.

备注Remarks

此属性的值是字符串,在 DAV 搜索和定位 (DASL) 语法中,该字符串代表当前的视图筛选器。The value of this property is a string, in DAV Searching and Locating (DASL) syntax, that represents the current filter for the view. 有关使用 DASL 语法筛选视图中的项目的详细信息,请参阅筛选项目For more information about using DASL syntax to filter items in a view, see Filtering Items.

示例Example

下面的 Visual Basic for Applications (VBA)示例通过使用**资源管理器** 对象的**CurrentView** 属性获取**View** 对象,然后将view对象的**Filter** 属性设置为仅显示上周收到的那些 Outlook 项目。The following Visual Basic for Applications (VBA) example obtains a View object by using the CurrentView property of the Explorer object, then sets the Filter property of the View object to display only those Outlook items that were received last week.

Private Sub FilterViewToLastWeek() 
 
 Dim objView As View 
 
 
 
 ' Obtain a View object reference to the current view. 
 
 Set objView = Application.ActiveExplorer.CurrentView 
 
 
 
 ' Set a DASL filter string, using a DASL macro, to show 
 
 ' only those items that were received last week. 
 
 objView.Filter = "%lastweek(""urn:schemas:httpmail:datereceived"")%" 
 
 
 
 ' Save and apply the view. 
 
 objView.Save 
 
 objView.Apply 
 
End Sub

另请参阅See also

日历视图对象CalendarView Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.