We are currently experiencing this error in US only but fine everywhere else. Can somebody please explain why I am getting this error and what is the fix please? I am at my wits end. Thanks
The code sLastSaved = ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeLastSaved).Value returns an automation error.
Code: Select all
Function SaveThisDocument() As Boolean
'
' SaveThisDocument Function
' Return true if document has been saved since it was last opened
'
Dim bFileSaved As Boolean
Dim sLastSaved As String
Dim strArray() As String
bFileSaved = ActiveDocument.Saved
SaveThisDocument = False
sLastSaved = ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeLastSaved).Value
strArray = Split(sLastSaved, "/")
If (Left$(strArray(2), 4) >= "2007") Then
' if document saved ALREADY (in current session) return true
' ODT value is set to current date+time when the doc is created or opened
SaveThisDocument = (CDate(sLastSaved) > CDate(GetValueOfCDP(sDocOpenDT)))
End If
ActiveDocument.Saved = bFileSaved
End Function