I've modified a Word Template's VB6 Macros to retrieve a Date of Birth Field. Unfortunately, when the value is retrieved it has a string value prefixed by a little square block and a lot of right-padded spaces which I can't seem to trim (eg. "1/3/57 ").
Can anyone here see what the problem is? Here's the code -
If ActiveDocument.Bookmarks.Exists("dob1") = True Then
personDOB = Mid(ActiveDocument.Bookmarks("dob1").Range.Text, 10, Len(ActiveDocument.Bookmarks("dob1").Range.Text))
personDOB = Trim$(offenderDOB)
End If
If Not IsDate(personDOB) Then
Msg = "Error: Please enter an Person Date of Birth with the format dd/mm/yyyy or leave blank"
Response = MsgBox(Msg, vbOKOnly, BadgeTitle)
End If