Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enter text into a form field and preserve the field

Status
Not open for further replies.

tebathe3

Programmer
Jan 17, 2004
89
US
odd question I know, but I actually need code to insert text into a form field and preserve the field. so in other words, i do not want to select the field and have the text replace it; it would look like you had just set the default text for a form field. is this possible?
 
Nevermind, I found the appropriate property, thanks.
 
Actually, I have just discovered the code I am using works in 2003, but not XP:

Code:
If ActiveDocument.Bookmarks.Exists("bmkDocketNo") Then
        ActiveDocument.Bookmarks("bmkDocketNo").Range.Fields(1).Result.Text = txtDocket.Text
    End If

Any ideas?
 
Formfields are members of both the formfield collection AND the bookmarks collection. Try using the Formfield collection, rather than the Bookmarks collection.
Code:
ActiveDocument.[COLOR=blue][b]Formfields[/b][/color blue]("bmkDocketNo").Result = txtDocket.Text

Is there a particular reason why you are using code the bookmark, rather than the formfield?

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top