T
TKovacs
I am having a couple of issues programmatically accessing form fields. I
have assigned “bookmark†names to these fields and here is how I can use VBA
to see what has been entered in the field.
Dim FieldText as string
FieldText = Word.ActiveDocument.Bookmarks("LastName").Range.Text
The problems :
A) I cannot detect when the field is empty
B) Empty fields have text value of 5 spaces, but return FALSE when compared
to being equal to 5 spaces
C) Trim seemingly has no effect, as “trim(FormField)†still = FormField = 5
spaces
D) Any attempt to erase the text in a form field by setting = Ҡerases the
form field, setting equal to 5 spaces also does not work.
I need to be able to detect an empty form field, and be able to erase text
in form fields. Any ideas?
have assigned “bookmark†names to these fields and here is how I can use VBA
to see what has been entered in the field.
Dim FieldText as string
FieldText = Word.ActiveDocument.Bookmarks("LastName").Range.Text
The problems :
A) I cannot detect when the field is empty
B) Empty fields have text value of 5 spaces, but return FALSE when compared
to being equal to 5 spaces
C) Trim seemingly has no effect, as “trim(FormField)†still = FormField = 5
spaces
D) Any attempt to erase the text in a form field by setting = Ҡerases the
form field, setting equal to 5 spaces also does not work.
I need to be able to detect an empty form field, and be able to erase text
in form fields. Any ideas?