Entering text into a formfield without deleting it? (1 Viewer)

dusty

Registered User.
Local time
Today, 14:58
Joined
Aug 20, 2009
Messages
42
Here is the code I am using to enter text from a text box in a userform into a formfield in a word document.

Set product = ActiveDocument.FormFields("ProductName").Range

product.Text = userform.productname

This is great apart from the fact that it deletes the form field when entering the text so if the user updates at a later date the form field is non existant.

i have searched around and remember reading somewhere about how to insert formfields but can't find it again.

any help would be great I assume i need to replace teh form field after entering the text how do i do this so that it wraps the text but also will be invisible when printing.

thanks dusty
 

Researcher

I.T. Veteran
Local time
Today, 14:58
Joined
Oct 11, 2006
Messages
42
If I understand you correctly, to insert form fields into a document, select the form toolbar from the view menu and from there you can choose the type of form field you want. Be sure to lock the form field by selecting the protect
form button on the form toolbar. Hope this helps....
 

dusty

Registered User.
Local time
Today, 14:58
Joined
Aug 20, 2009
Messages
42
Thanks for the reply researcher

I had not potected the page that was my problem.

Problem is almost solved is there anyway I can just protect selected pages?

I will stop being lazys and search im sure it will be easy to find :D

but if somone gets there before me great
 

Researcher

I.T. Veteran
Local time
Today, 14:58
Joined
Oct 11, 2006
Messages
42
Sorry for the delay, was on a long weekend...I believe, when you add form fields to a document, all the pages that have form fields will be protected, you would have to make separate documents, but you can combine form fields and other extraneous text together on one document.
 

Users who are viewing this thread

Top Bottom