【发布时间】:2015-08-18 15:20:08
【问题描述】:
在 Excel 中,您可以使用 VBA 编码找出最后一个条目是在特定单元格中输入的时间。
我想知道在 Word 中是否也可以这样做。
我特别想知道上次输入的时间和日期。
【问题讨论】:
在 Excel 中,您可以使用 VBA 编码找出最后一个条目是在特定单元格中输入的时间。
我想知道在 Word 中是否也可以这样做。
我特别想知道上次输入的时间和日期。
【问题讨论】:
在 Word 中,您无法获取特定 Word 输入文档的时间。您可以获得的是文件最后一次保存的时间:
Sub PrintLastSaveTime()
Dim propLastSaved As DocumentProperty
Dim propLastAuthor As DocumentProperty
Set propLastSaved = ActiveDocument.BuiltInDocumentProperties(WdBuiltInProperty.wdPropertyTimeLastSaved)
Set propLastAuthor = ActiveDocument.BuiltInDocumentProperties(WdBuiltInProperty.wdPropertyLastAuthor)
Debug.Print "The document was last saved by " & propLastAuthor.Value & " at "; propLastSaved.Value
End Sub
【讨论】: