Including merge field in hyperlink

  • Thread starter Saville Kaufman
  • Start date
S

Saville Kaufman

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.

Your help would be much appreciated.
 
C

Cindy M -WordMVP-

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 :)
 
S

Saville Kaufman

Hi Cindy,

Thanks for that, but it is not doing the trick. The reason being that I am
wanting to do this merge to an email. What I thought I could do is create a
field in my database query which looks like this:

<a href='http://www.xyz.com?ci=-1243184984'>here</a>
 
S

Saville Kaufman

Hi Cindy

Sorry, but I inadvertently sent the previous mail before completing the text.

I have created a new field in my database query to produce the following:

<a href='http://www.cnn.com?ci=1234567'>here</a>

Where 1234567 is the variable data I require.

I then thought I would place this field into my merge document and all would
be sorted. How ever the problem now is that in the emails source code I get
the following:

<a href='http://www.cnn.com?ci=1234567'>here</a>

How do I prevent the < from appearing as < in the source code?

Your help would be much appreciated.

Saville Kaufman
 
S

Saville Kaufman

Hi Cindy

Sorry again but the end of my mail did not print out as required. See
changes to this email.

I have created a new field in my database query to produce the following:

<a href='http://www.cnn.com?ci=1234567'>here</a>

Where 1234567 is the variable data I require.

I then thought I would place this field into my merge document and all would
be sorted. However the problem now is that in the emails source code the
greater than and less than signs are replaced by "ampisand lt" and "ampisand
gt".

How do I prevent the < from appearing as (ampisand lt) in the source code?

Your help would be much appreciated.

Saville Kaufman
 
C

Cindy M -WordMVP-

Hi Saville,

What you're running into here is the fact that Word is translating literally
everything in the main merge document into text in the email. You can't put
HTML tags in a Word document that you're merging to email, it just doesn't
work. The converter used to create the email message expects links to be in a
Hyperlink field. That's the only functionality it provides.

It sounds as if you need a third-party utility to create these emails. You
should find a listing at slipstick.com
I have created a new field in my database query to produce the following:

<a href='http://www.cnn.com?ci=1234567'>here</a>

Where 1234567 is the variable data I require.

I then thought I would place this field into my merge document and all would
be sorted. However the problem now is that in the emails source code the
greater than and less than signs are replaced by "ampisand lt" and "ampisand
gt".

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top