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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting text from a Form Field in Word

Status
Not open for further replies.

ennius

MIS
Sep 17, 2002
5
US
Hi, I'm having some problems trying to figure this one out.

I have a template in which a user can insert information into several text form fields. I then want to be able to extract this information and store it elsewhere...any ideas on how I could accomplish this?

Appreciate your help-
norm
 
[tt]
Why not use html form?
or does it have to be in word...
[tt]"A Successful man is one who can build
a firm foundation with the bricks
that others throw at him"
[/tt]

banana.gif
rockband.gif
banana.gif
 
It has to be a word document unfortunately...so I'm using VBA to get a solution.

-norm
 
To get the entered information use Result: (syntax is probably a little off, I call this from a Delphi program, but Result is what you need):

Word.ActiveDocument.FormFields.Item(strBookMark).Result Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Hi!

Leslie is right, something like this:

If ActiveDocument.Bookmarks.Exists(sField) Then
sYourVariable = ActiveDocument.FormFields(sField).Result
Else
MsgBox "The bookmark doesn't exist!"
End If

Because the user might delete bookmarks, it might also be wise to check whether the bookmark exists, before doing anything, and then have some error message appear if not

Roy-Vidar
 
you guys are awesome. Thanks for the help!

-n-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top