Hi =?Utf-8?B?U2F2aWxsZSBLYXVmbWFu?=,
Is there a way that I can include a merge field in a hyperlink. For example I
might want the following
http://www.abc.com?id=12345 where 12345 is taken
from my data table.
Word creates Hyperlinks using Hyperlink fields. You can manually create a
Hyperlink field using Ctrl+F9 to insert the field brackets and insert the
Mergefield in place of part of the hyperlink path, but you have to be careful.
This is what I usually do (but not often):
- Set up the entire merge document, except for the hyperlink
- Insert a Hyperlink field to a similar URL so that I'm sure to get the
right syntax
- Ctrl+F9 to insert field brackets
- Type in the field information, and insert the merge field
- IMMEDIATELY execute the merge to a new document
- Ctrl+A, F9 to force the fields to update
- Alt+F9 to view the result
If you don't do it in this order, the Hyperlink field will DISPLAY the URL for
the first record in all records, rather than the URL to the actual target. There
is no way to set the display text as part of the field code.
Your only other option would be to use VBA to create the Hyperlinks after the
merge has completed.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail
![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)