How to set default text in a text form field

S

Scott Nemitz

Is it possible through code to change the default text
property in a text form field???

I am updating some word templates where I am using a text
form field as an object to find and update the value of.
However, if you update all fields after the macro runs,
all text form fields revert to the default text. So to
prevent Word from changing what I updated, I want to
change the default text in the form field but can't find a
method to do that.
 
D

Doug Robbins - Word MVP

Use the .Result property of the formfield to set the text in it

ActiveDocument.Formfields("BookmarkName").Result = "Text to display"

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
T

Theo Hayes

I believe you are trying to access the default text
property

ActiveDocument.FormFields
("YourFieldName").TextInput.Default = "YourDefaultText"

This changes the default text of the field but you need to
update the fields for it to actually discplay on the
screen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top