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!

Combining form fields (adding 2 non-numeric fields together)

Status
Not open for further replies.

random260

Programmer
Mar 11, 2002
116
US
Theres got to be a way to combine form fields in Microsoft Word but I can't find it. If I have three fields (Call them Text1, Text2, and Text3) I can use an equation / Formula field to put the contents of Text1 OR Text2 into Text3, but how do I put BOTH in? i.e., if Text1 contains "John" and Text2 contains "Doe" I can get "John" or "Doe" to automatically appear in Text3 but not both (i.e. "JohnDoe" or "John Doe". I tried things like Text1&Text2 or Text1 & Text2 or Text1 & " " & text2 but Nothing works - must be something simple I am missing here. Ideally I need to create something like John&Doe&121&Main&street from a bunch of fields.

Thanks
Steve

Thanks
 
use .Result property of the formfields, and concatenate them. could do directly, or make string variables of them.

strResultText1 = ActiveDocument.FormFields("Text1").Result
strResultText2 = ActiveDocument.FormFields("Text2").Result
ActiveDocument.FormFields("Text3").Result = strResultText1 & " " & strResultText2


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top