Apr 09 2021 04:38 AM - edited Apr 09 2021 04:50 AM
Option Explicit
Public Sub Test()
Dim k As String, d As Date
k = "06.02.2021"
d = DateValue(k)
ActiveDocument.CustomDocumentProperties("Testdatum").Value = d
ActiveDocument.PrintPreview
MsgBox k & vbCrLf & CStr(d) & vbCrLf & CStr(ActiveDocument.CustomDocumentProperties("Testdatum").Value)
End Sub
{ DOCPROPERTY Testdatum \@ "dd.MM.yyyy" \* MERGEFORMAT } = 05.02.2021
also 1 Tag weniger...
Programmierfehler in Word?