Outlook) (CalendarView.Filter 屬性

會傳回或設定 String 值,代表檢視的篩選。 讀取/寫入。

語法

expressionFilter

表達 代表 CalendarView 物件的變數。

註解

此屬性值為使用「DAV 搜尋及尋找」(DASL) 語法的字串,代表檢視的目前篩選。 如需使用 DASL 語法在檢視中篩選項目的詳細資訊,請參閱篩選項目

範例

下列 Visual Basic for Applications (VBA) 範例會使用Explorer物件的CurrentView屬性取得View物件,然後將View物件的Filter屬性設定為只顯示上周收到的 Outlook 專案。

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

另請參閱

CalendarView 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應