ReportItem.LastModificationTime 属性 (Outlook)ReportItem.LastModificationTime Property (Outlook)

返回指定的日期和时间的 Outlook 项目的上次修改日期Returns a Date specifying the date and time that the Outlook item was last modified. 只读。Read-only.

语法Syntax

表达式expression. LastModificationTime

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

注解Remarks

此属性对应于 MAPI 属性PidTagLastModificationTimeThis property corresponds to the MAPI property PidTagLastModificationTime.

示例Example

本 Visual Basic for Applications 示例使用**Items.Restrict** 方法应用筛选器联系人项目的LastModificationTime属性所基于的项目。This Visual Basic for Applications example uses the Items.Restrict method to apply a filter to contact items based on the item's LastModificationTime property. 您可以应用类似的方法来筛选其他 Outlook 项目的 LastModificationTime 属性。You can apply a similar approach to filter on the LastModificationTime property of other Outlook items.

Public Sub ContactDateCheck() 
 
 Dim myNamespace As Outlook.NameSpace 
 
 Dim myContacts As Outlook.Items 
 
 Dim myItems As Outlook.Items 
 
 Dim myItem As Object 
 
 
 
 Set myNamespace = Application.GetNamespace("MAPI") 
 
 Set myContacts = myNamespace.GetDefaultFolder(olFolderContacts).Items 
 
 Set myItems = myContacts.Restrict("[LastModificationTime] > '01/1/2003'") 
 
 For Each myItem In myItems 
 
 If (myItem.Class = olContact) Then 
 
 MsgBox myItem.FullName & ": " & myItem.LastModificationTime 
 
 End If 
 
 Next 
 
End Sub

以下 Visual Basic for Applications 示例除演示在筛选条件中使用变量外与上例相同。The following Visual Basic for Applications example is the same as the example above, except that it demonstrates the use of a variable in the filter.

Public Sub ContactDateCheck2() 
 
 Dim myNamespace As Outlook.NameSpace 
 
 Dim myContacts As Outlook.Items 
 
 Dim myItem As Object 
 
 Dim DateStart As Date 
 
 Dim DateToCheck As String 
 
 Dim myRestrictItems As Outlook.Items 
 
 
 
 Set myNameSpace = Application.GetNamespace("MAPI") 
 
 Set myContacts = myNameSpace.GetDefaultFolder(olFolderContacts).Items 
 
 DateStart = #01/1/2003# 
 
 DateToCheck = "[LastModificationTime] >= """ & DateStart & """" 
 
 Set myRestrictItems = myContacts.Restrict(DateToCheck) 
 
 For Each myItem In myRestrictItems 
 
 If (myItem.Class = olContact) Then 
 
 MsgBox myItem.FullName & ": " & myItem.LastModificationTime 
 
 End If 
 
 Next 
 
End Sub

另请参阅See also

报表项的对象ReportItem 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.