Is it possible to set up a word document so the format and text cannot be
changed but the field information can be read with vba. It seems that the
inability to select the contents of a field from code prevents reading it.
Maurice
Hi Maurice,
The key here is that you don't have to select anything in order to
read the field contents from VBA.
Each form field has a name (the entry in the "Bookmark" box in the
field's Properties dialog, which you can change to make it meaningful
instead of the default like Text1). If you know which field you want
to read and you know its name, your macro can assign its contents to a
string variable this way:
myString = ActiveDocument.FormFields("Text1").Result
Look at the code in
http://word.mvps.org/FAQs/TblsFldsFms/ValidateFFields.htm for more
examples of how to do this.
--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.