How to preserve a hyperlink inside a IF field

S

Sunil Sudhakaran

Hi,

I have a document that contain many IF fields. If I add a hyperlink inside a
if field pointing to a bookmark outside IF field then while closing and
reopening the doc (Word 2003) the hyperlink info is lost. Is there a way to
retain the same?

Thanks and regards
Sunil S.
 
P

Peter Jamieson

Here, what I see is that you can put a hyperlink field into the result of an
IF field, but when you ctrl-click it within Word the link doesn't function.
Saving, closing and re-opening seems to preserve the hyperlink field, but it
still doesn't work. But maybe you are seeing something different?
 
G

Graham Mayor

It might work if the IF field is nested within the Hyperlink field eg Insert
a hyperlink with display text added to the display text window. Then toggle
the hyperlink field and replace the linked location with the IF field thus:

{ HYPERLINK \l "{ IF { REF Test } = 1 "Page3" "Page4" }" }

The above example works within the document to link to bookmarks Page3 or
Page4 according to the setting of the bookmark Test. I see no reason why it
should not link outside the document?
The display text doesn't change when the fields are updated.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Sunil Sudhakaran

Hi,

Thanks all for your inputs. I will make my question more clear.

I have many IF fields in a doc. Each IF fields have at least two paragraphs
under it.
I am using the mail merge feature of the word to generate the manual for
different customers. The doc is linked to a external data source. The data
source is a .xls file. Based on whether the mergefiled condition is satisfied
I am including a particular topic as shown below.

{ if { MERGEFIELD ETHERNET } ="Y"

" paragraph1
paragraph2
"
}

If I am linking a word that comes inside the IF field to a bookmark outside
the IF field then the hyperlink is not retained while closing and reopening
the doc. The links works fine if am a not linking the doc with the external
data source.

Regards
Sunil S.
 
P

Peter Jamieson

As I said before, the hyperlinks do not seem to work if they are in the
result text of an IF field. (here, it does not seem to matter whether you
are linked to a data source or not).

Presumably you are not actually merging the document - if you do, you lose
the bookmarks so the hyperlink won't work anyway. So maybe you are just
previewing.

Hyperlinks do work if they come from an INCLUDETEXTed document. As long as
your ETHERNET field can only take specific values (say "Y", "N" or "" ) then
you can exploit this by
a. creating a document (let's call it mytexts.doc) that contains each of
the texts you need, including hyperlinks that reference the correct bookmark
b. bookmarking the texts BMY, BMN and BM
c. using { INCLUDETEXT "the full path name of mytexts.doc" { MERGEFIELD
ETHERNET } } to insert the bookmarked texts

You may have to select and re-execute the INCLUDETEXT fields before they
will work properly, especially if you use

{ HYPERLINK "{ FILENAME }" \l "bookmarkname" } within mytexts.doc to avoid
hard-coding the including document name.

This approach has another problem in that you rely on the linked .doc file -
you can't use ctrl-shift-F9 to remove the INCLUDETEXT without also
destroying the hyperlink.
 

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