Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default Can't set display text for hyperlink created in merged Word doc fromExcel data source

Hi:

Merging fields from an Excel 2003 data source to Word 2003 document,
you can create active links (hyperlinks) into the merged document, but
evidently can't set the display text of the link -- the link displays
as itself. This is especially ugly if the path is a network mapped
drive.

Thus, with the ugly URL below, there's no evident way to dress it up
with 'text to display' separate from the URL itself, as far as I've
been able to determine.

If anybody has found a way to do this, it would be very helpful.

-- Roy Zider

Source URL (SrcURL field):
G:\\ABC Email\\Exported\\JLB 2008-06-24\\Chron - extracted\\ABC
Estate_ Contact information.eml

Field codes in merge template:
{HYPERLINK "{MERGEFIELD "SrcURL"}"\@ MERGEFORMAT }

Active link in merged document:
\\k7n\g\ABC Email\Exported\JLB 2008-06-24\Chron - extracted\ABC
Estate_ Contact information.eml

Also annoying is the fact that even if the Excel source document has
active hyperlinks in a field, the merge of this field will transfer
only as text, not as an active hyperlink. So a separate field in
Excel has to be created with the path and file name with double \\ to
generate the \ separators, and use that as the source rather than the
hyperlink itself.

References:
http://homepage.swissonline.ch/cindy...r/MergFram.htm
http://www.gmayor.com/formatting_word_fields.htm
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Can't set display text for hyperlink created in merged Word doc from Excel data source

The only way I know is to use VBA to modify the display text, either during
the merge or as a post-merge operation.

I only have the following code for doing it during the merge, and I haven't
tested this code for some time. To see it working

1. Create a new document, connect it to your data source, and insert one
merge field and a bookmark named "mybm"

2. Open up the VBA Editor and
a. insert a class module.
b. name it EventClassModule in the properties box
c. Copy the following code into the module:

Public WithEvents App As Word.Application

Private Sub App_MailMergeBeforeRecordMerge(BYVal Doc As Document, Cancel As
Boolean)
Dim dt as String
Dim lt as String
Dim h as Hyperlink
Dim r as Range

' set the range variable to our placeholder bookmark
Set r = Doc.Bookmarks("mybm").Range

' delete any existing text (this is needed for records after record 1)
r.Text = ""

' construct the link text that you want. I'm assuming your data source
' has fields called idfield and namefield.
lt = http://www.testsite.com?id= & _
Doc.MailMerge.DataSource.DataFields("idfield") & _
"&name=" & _
Doc.MailMerge.DataSource.DataFields("namefield")
' set up the display text that you want. If it should be the same
' as the link text, do that:
dt = lt

' insert the hyperlink you want
Set h = Doc.Hyperlinks.Add(Anchor:=r, Address=lt, TextToDisplay:=dt)

' Set mybm to "cover" the inserted link so it is easy to delete the old
hyperlink

Doc.Bookmarks.Add Name:="mybm", Range:=h.Range

Set r = Nothing
Set h = Nothing

End Sub

3. Insert an ordinary module (the name does not matter) and insert the
following code:

Dim x As New EventClassModule

Sub autoopen()
Set x.App = Word.Application
End Sub

4. Save and close the document. Open it to trigger the autoopen, then
perform a test merge.

NB, if you start changing the code you may find that you need to re-run your
autoopen code again, and/or save/close/open the document.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"FUBARinSFO" wrote in message
...
Hi:

Merging fields from an Excel 2003 data source to Word 2003 document,
you can create active links (hyperlinks) into the merged document, but
evidently can't set the display text of the link -- the link displays
as itself. This is especially ugly if the path is a network mapped
drive.

Thus, with the ugly URL below, there's no evident way to dress it up
with 'text to display' separate from the URL itself, as far as I've
been able to determine.

If anybody has found a way to do this, it would be very helpful.

-- Roy Zider

Source URL (SrcURL field):
G:\\ABC Email\\Exported\\JLB 2008-06-24\\Chron - extracted\\ABC
Estate_ Contact information.eml

Field codes in merge template:
{HYPERLINK "{MERGEFIELD "SrcURL"}"\@ MERGEFORMAT }

Active link in merged document:
\\k7n\g\ABC Email\Exported\JLB 2008-06-24\Chron - extracted\ABC
Estate_ Contact information.eml

Also annoying is the fact that even if the Excel source document has
active hyperlinks in a field, the merge of this field will transfer
only as text, not as an active hyperlink. So a separate field in
Excel has to be created with the path and file name with double \\ to
generate the \ separators, and use that as the source rather than the
hyperlink itself.

References:
http://homepage.swissonline.ch/cindy...r/MergFram.htm
http://www.gmayor.com/formatting_word_fields.htm


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Can't set display text for hyperlink created in merged Word doc from Excel data source

Also, Jay Freedman posted this link to some simpler VBA..

http://groups.google.com/group/micro....public.word.*

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Peter Jamieson" wrote in message
...
The only way I know is to use VBA to modify the display text, either
during the merge or as a post-merge operation.

I only have the following code for doing it during the merge, and I
haven't tested this code for some time. To see it working

1. Create a new document, connect it to your data source, and insert one
merge field and a bookmark named "mybm"

2. Open up the VBA Editor and
a. insert a class module.
b. name it EventClassModule in the properties box
c. Copy the following code into the module:

Public WithEvents App As Word.Application

Private Sub App_MailMergeBeforeRecordMerge(BYVal Doc As Document, Cancel
As
Boolean)
Dim dt as String
Dim lt as String
Dim h as Hyperlink
Dim r as Range

' set the range variable to our placeholder bookmark
Set r = Doc.Bookmarks("mybm").Range

' delete any existing text (this is needed for records after record 1)
r.Text = ""

' construct the link text that you want. I'm assuming your data source
' has fields called idfield and namefield.
lt = http://www.testsite.com?id= & _
Doc.MailMerge.DataSource.DataFields("idfield") & _
"&name=" & _
Doc.MailMerge.DataSource.DataFields("namefield")
' set up the display text that you want. If it should be the same
' as the link text, do that:
dt = lt

' insert the hyperlink you want
Set h = Doc.Hyperlinks.Add(Anchor:=r, Address=lt, TextToDisplay:=dt)

' Set mybm to "cover" the inserted link so it is easy to delete the old
hyperlink

Doc.Bookmarks.Add Name:="mybm", Range:=h.Range

Set r = Nothing
Set h = Nothing

End Sub

3. Insert an ordinary module (the name does not matter) and insert the
following code:

Dim x As New EventClassModule

Sub autoopen()
Set x.App = Word.Application
End Sub

4. Save and close the document. Open it to trigger the autoopen, then
perform a test merge.

NB, if you start changing the code you may find that you need to re-run
your
autoopen code again, and/or save/close/open the document.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"FUBARinSFO" wrote in message
...
Hi:

Merging fields from an Excel 2003 data source to Word 2003 document,
you can create active links (hyperlinks) into the merged document, but
evidently can't set the display text of the link -- the link displays
as itself. This is especially ugly if the path is a network mapped
drive.

Thus, with the ugly URL below, there's no evident way to dress it up
with 'text to display' separate from the URL itself, as far as I've
been able to determine.

If anybody has found a way to do this, it would be very helpful.

-- Roy Zider

Source URL (SrcURL field):
G:\\ABC Email\\Exported\\JLB 2008-06-24\\Chron - extracted\\ABC
Estate_ Contact information.eml

Field codes in merge template:
{HYPERLINK "{MERGEFIELD "SrcURL"}"\@ MERGEFORMAT }

Active link in merged document:
\\k7n\g\ABC Email\Exported\JLB 2008-06-24\Chron - extracted\ABC
Estate_ Contact information.eml

Also annoying is the fact that even if the Excel source document has
active hyperlinks in a field, the merge of this field will transfer
only as text, not as an active hyperlink. So a separate field in
Excel has to be created with the path and file name with double \\ to
generate the \ separators, and use that as the source rather than the
hyperlink itself.

References:
http://homepage.swissonline.ch/cindy...r/MergFram.htm
http://www.gmayor.com/formatting_word_fields.htm



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chris Chris is offline
external usenet poster
 
Posts: 237
Default Can't set display text for hyperlink created in merged Word do

Thanks for that...but it is a bit above me and want to ask a simple question:

I am trying to send an Outlook 03 email using Word 03 to merge info from an
Excel 03 datasource which includes a couple of URL fields and have it say
"Click Here" (hiding the full URL using a href=" URL" Click Here/A )

But it doesn't hide the URL and make "Click Here" hot....

Any Ideas?

"Peter Jamieson" wrote:

Also, Jay Freedman posted this link to some simpler VBA..

http://groups.google.com/group/micro....public.word.*

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Peter Jamieson" wrote in message
...
The only way I know is to use VBA to modify the display text, either
during the merge or as a post-merge operation.

I only have the following code for doing it during the merge, and I
haven't tested this code for some time. To see it working

1. Create a new document, connect it to your data source, and insert one
merge field and a bookmark named "mybm"

2. Open up the VBA Editor and
a. insert a class module.
b. name it EventClassModule in the properties box
c. Copy the following code into the module:

Public WithEvents App As Word.Application

Private Sub App_MailMergeBeforeRecordMerge(BYVal Doc As Document, Cancel
As
Boolean)
Dim dt as String
Dim lt as String
Dim h as Hyperlink
Dim r as Range

' set the range variable to our placeholder bookmark
Set r = Doc.Bookmarks("mybm").Range

' delete any existing text (this is needed for records after record 1)
r.Text = ""

' construct the link text that you want. I'm assuming your data source
' has fields called idfield and namefield.
lt = http://www.testsite.com?id= & _
Doc.MailMerge.DataSource.DataFields("idfield") & _
"&name=" & _
Doc.MailMerge.DataSource.DataFields("namefield")
' set up the display text that you want. If it should be the same
' as the link text, do that:
dt = lt

' insert the hyperlink you want
Set h = Doc.Hyperlinks.Add(Anchor:=r, Address=lt, TextToDisplay:=dt)

' Set mybm to "cover" the inserted link so it is easy to delete the old
hyperlink

Doc.Bookmarks.Add Name:="mybm", Range:=h.Range

Set r = Nothing
Set h = Nothing

End Sub

3. Insert an ordinary module (the name does not matter) and insert the
following code:

Dim x As New EventClassModule

Sub autoopen()
Set x.App = Word.Application
End Sub

4. Save and close the document. Open it to trigger the autoopen, then
perform a test merge.

NB, if you start changing the code you may find that you need to re-run
your
autoopen code again, and/or save/close/open the document.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"FUBARinSFO" wrote in message
...
Hi:

Merging fields from an Excel 2003 data source to Word 2003 document,
you can create active links (hyperlinks) into the merged document, but
evidently can't set the display text of the link -- the link displays
as itself. This is especially ugly if the path is a network mapped
drive.

Thus, with the ugly URL below, there's no evident way to dress it up
with 'text to display' separate from the URL itself, as far as I've
been able to determine.

If anybody has found a way to do this, it would be very helpful.

-- Roy Zider

Source URL (SrcURL field):
G:\\ABC Email\\Exported\\JLB 2008-06-24\\Chron - extracted\\ABC
Estate_ Contact information.eml

Field codes in merge template:
{HYPERLINK "{MERGEFIELD "SrcURL"}"\@ MERGEFORMAT }

Active link in merged document:
\\k7n\g\ABC Email\Exported\JLB 2008-06-24\Chron - extracted\ABC
Estate_ Contact information.eml

Also annoying is the fact that even if the Excel source document has
active hyperlinks in a field, the merge of this field will transfer
only as text, not as an active hyperlink. So a separate field in
Excel has to be created with the path and file name with double \\ to
generate the \ separators, and use that as the source rather than the
hyperlink itself.

References:
http://homepage.swissonline.ch/cindy...r/MergFram.htm
http://www.gmayor.com/formatting_word_fields.htm




  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default Can't set display text for hyperlink created in merged Word docfrom Excel data source

Peter:

Working on your code now. Had hoped to be able to avoid this, but I
guess not.

-- Roy


  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default Can't set display text for hyperlink created in merged Word docfrom Excel data source

' construct the link text that you want. I'm assuming your data
source
' has fields called idfield and namefield.
lt = http://www.testsite.com?id= & _
Doc.MailMerge.DataSource.DataFields("idfield") & _
"&name=" & _
Doc.MailMerge.DataSource.DataFields("namefield")

Peter:

I'm linking to a local data source, not a remote URL. I'm testing
some code now, but don't have the magic strings to link to
"srcExcelData.xls".

-- Roy
  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default Can't set display text for hyperlink created in merged Word docfrom Excel data source

Ignore prior comment -- got link to local folder OK now.
  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default Can't set display text for hyperlink created in merged Word docfrom Excel data source

Peter:

OK, got it now. Some confusion on my part about the instructions, but
"ask the computer" came through with the answer, as usual.

Thanks again.

-- Roy Zider

Public WithEvents App As Word.Application

Private Sub App_MailMergeBeforeRecordMerge(ByVal Doc As Document,
Cancel As Boolean)
Dim dt As String
Dim lt As String
Dim h As Hyperlink
Dim r As Range


' set the range variable to our placeholder bookmark
Set r = Doc.Bookmarks("mybm").Range

' delete any existing text (this is needed for records after record 1)
r.Text = ""

' construct the link text that you want. I'm assuming your data source
' has fields called idfield and namefield.
' lt = "http://www.testsite.com?id=" & _
' Doc.MailMerge.DataSource.DataFields("idfield") & _
' "&name=" & _
' Doc.MailMerge.DataSource.DataFields("namefield")

' my hyperlink is in the local Excel file in field SrcLink2, as the
link text string
lt = Doc.MailMerge.DataSource.DataFields("SrcLink2")

' set up the display text that you want. If it should be the same
' as the link text, do that:
' dt = lt
' my display text is in field SrcSJ (source subject)
dt = Doc.MailMerge.DataSource.DataFields("SrcSJ")

' message box for testing
' MsgBox "lt: " & lt & vbCrLf & _
"dt: " & dt


' the hyperlink you want
Set h = Doc.Hyperlinks.Add(Anchor:=r, Address:=lt, TextToDisplay:=dt)

' Set mybm to "cover" the inserted link so it is easy to delete the
old hyperlink
Doc.Bookmarks.Add Name:="mybm", Range:=h.Range

Set r = Nothing
Set h = Nothing


End Sub






  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Can't set display text for hyperlink created in merged Word doc from Excel data source

Thans for posting back - it's useful to have confirmation that this approach
still works.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"FUBARinSFO" wrote in message
...
Peter:

OK, got it now. Some confusion on my part about the instructions, but
"ask the computer" came through with the answer, as usual.

Thanks again.

-- Roy Zider

Public WithEvents App As Word.Application

Private Sub App_MailMergeBeforeRecordMerge(ByVal Doc As Document,
Cancel As Boolean)
Dim dt As String
Dim lt As String
Dim h As Hyperlink
Dim r As Range


' set the range variable to our placeholder bookmark
Set r = Doc.Bookmarks("mybm").Range

' delete any existing text (this is needed for records after record 1)
r.Text = ""

' construct the link text that you want. I'm assuming your data source
' has fields called idfield and namefield.
' lt = "http://www.testsite.com?id=" & _
' Doc.MailMerge.DataSource.DataFields("idfield") & _
' "&name=" & _
' Doc.MailMerge.DataSource.DataFields("namefield")

' my hyperlink is in the local Excel file in field SrcLink2, as the
link text string
lt = Doc.MailMerge.DataSource.DataFields("SrcLink2")

' set up the display text that you want. If it should be the same
' as the link text, do that:
' dt = lt
' my display text is in field SrcSJ (source subject)
dt = Doc.MailMerge.DataSource.DataFields("SrcSJ")

' message box for testing
' MsgBox "lt: " & lt & vbCrLf & _
"dt: " & dt


' the hyperlink you want
Set h = Doc.Hyperlinks.Add(Anchor:=r, Address:=lt, TextToDisplay:=dt)

' Set mybm to "cover" the inserted link so it is easy to delete the
old hyperlink
Doc.Bookmarks.Add Name:="mybm", Range:=h.Range

Set r = Nothing
Set h = Nothing


End Sub







  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Can't set display text for hyperlink created in merged Word doc from Excel data source

BTW by using this technique you really ought to be able to avoid the probem
of having a separate field with the doubled-up backslashes, by e.g. using
replace() in VBA to replace single backslashes in the field values.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"FUBARinSFO" wrote in message
...
Peter:

OK, got it now. Some confusion on my part about the instructions, but
"ask the computer" came through with the answer, as usual.

Thanks again.

-- Roy Zider

Public WithEvents App As Word.Application

Private Sub App_MailMergeBeforeRecordMerge(ByVal Doc As Document,
Cancel As Boolean)
Dim dt As String
Dim lt As String
Dim h As Hyperlink
Dim r As Range


' set the range variable to our placeholder bookmark
Set r = Doc.Bookmarks("mybm").Range

' delete any existing text (this is needed for records after record 1)
r.Text = ""

' construct the link text that you want. I'm assuming your data source
' has fields called idfield and namefield.
' lt = "http://www.testsite.com?id=" & _
' Doc.MailMerge.DataSource.DataFields("idfield") & _
' "&name=" & _
' Doc.MailMerge.DataSource.DataFields("namefield")

' my hyperlink is in the local Excel file in field SrcLink2, as the
link text string
lt = Doc.MailMerge.DataSource.DataFields("SrcLink2")

' set up the display text that you want. If it should be the same
' as the link text, do that:
' dt = lt
' my display text is in field SrcSJ (source subject)
dt = Doc.MailMerge.DataSource.DataFields("SrcSJ")

' message box for testing
' MsgBox "lt: " & lt & vbCrLf & _
"dt: " & dt


' the hyperlink you want
Set h = Doc.Hyperlinks.Add(Anchor:=r, Address:=lt, TextToDisplay:=dt)

' Set mybm to "cover" the inserted link so it is easy to delete the
old hyperlink
Doc.Bookmarks.Add Name:="mybm", Range:=h.Range

Set r = Nothing
Set h = Nothing


End Sub









  #11   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Can't set display text for hyperlink created in merged Word do

There are a number of separate issues here

First of all, if you merge to e-mail sending a hyperlink of any kind, the
recipient does nto necessarily see a clickable hyperlink. It depends on the
mail format that you specify (HTML, plain text, attachment) and the
capabilities and options in the recipient's e-mail client.

For example, if you merge to plain text via Word 2003/OL2003, as far as I
can see if you
also use OL2003 to receive/view the e-mail, it does not display a clickable
link no matter what you do in Word, despite the fact that in this scenario,
OL2003 thinks it has received an HTML format e-mail (and as far as I can
tell, actually sends an HTML format e-mail unless you happen to open the
plain text e-mail in the out basket before it is sent).

So you have to use HTML format, and you don't get much control over the end
result when you do that from Word.

You also have to consider what the user at the othe end is going to do with
a link that says "Click here" these days.

If the clickable link is to the /same/ target every time, AFAIK all you do
is insert a Word HYPERLINK in your mail merge main document with the correct
link, then modify the display text. Then merge to HTML. I think.

If the link is to a different target then as far as I know there is no
simple option other than the "Use VBA and Word Events" that I have described
elsewhere in this conversation. It's actually not that hard to do if you are
willing to step through the example.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"chris" wrote in message
...
Thanks for that...but it is a bit above me and want to ask a simple
question:

I am trying to send an Outlook 03 email using Word 03 to merge info from
an
Excel 03 datasource which includes a couple of URL fields and have it say
"Click Here" (hiding the full URL using a href=" URL" Click Here/A )

But it doesn't hide the URL and make "Click Here" hot....

Any Ideas?

"Peter Jamieson" wrote:

Also, Jay Freedman posted this link to some simpler VBA..

http://groups.google.com/group/micro....public.word.*

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Peter Jamieson" wrote in message
...
The only way I know is to use VBA to modify the display text, either
during the merge or as a post-merge operation.

I only have the following code for doing it during the merge, and I
haven't tested this code for some time. To see it working

1. Create a new document, connect it to your data source, and insert
one
merge field and a bookmark named "mybm"

2. Open up the VBA Editor and
a. insert a class module.
b. name it EventClassModule in the properties box
c. Copy the following code into the module:

Public WithEvents App As Word.Application

Private Sub App_MailMergeBeforeRecordMerge(BYVal Doc As Document,
Cancel
As
Boolean)
Dim dt as String
Dim lt as String
Dim h as Hyperlink
Dim r as Range

' set the range variable to our placeholder bookmark
Set r = Doc.Bookmarks("mybm").Range

' delete any existing text (this is needed for records after record 1)
r.Text = ""

' construct the link text that you want. I'm assuming your data source
' has fields called idfield and namefield.
lt = http://www.testsite.com?id= & _
Doc.MailMerge.DataSource.DataFields("idfield") & _
"&name=" & _
Doc.MailMerge.DataSource.DataFields("namefield")
' set up the display text that you want. If it should be the same
' as the link text, do that:
dt = lt

' insert the hyperlink you want
Set h = Doc.Hyperlinks.Add(Anchor:=r, Address=lt, TextToDisplay:=dt)

' Set mybm to "cover" the inserted link so it is easy to delete the old
hyperlink

Doc.Bookmarks.Add Name:="mybm", Range:=h.Range

Set r = Nothing
Set h = Nothing

End Sub

3. Insert an ordinary module (the name does not matter) and insert the
following code:

Dim x As New EventClassModule

Sub autoopen()
Set x.App = Word.Application
End Sub

4. Save and close the document. Open it to trigger the autoopen, then
perform a test merge.

NB, if you start changing the code you may find that you need to re-run
your
autoopen code again, and/or save/close/open the document.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"FUBARinSFO" wrote in message
...
Hi:

Merging fields from an Excel 2003 data source to Word 2003 document,
you can create active links (hyperlinks) into the merged document, but
evidently can't set the display text of the link -- the link displays
as itself. This is especially ugly if the path is a network mapped
drive.

Thus, with the ugly URL below, there's no evident way to dress it up
with 'text to display' separate from the URL itself, as far as I've
been able to determine.

If anybody has found a way to do this, it would be very helpful.

-- Roy Zider

Source URL (SrcURL field):
G:\\ABC Email\\Exported\\JLB 2008-06-24\\Chron - extracted\\ABC
Estate_ Contact information.eml

Field codes in merge template:
{HYPERLINK "{MERGEFIELD "SrcURL"}"\@ MERGEFORMAT }

Active link in merged document:
\\k7n\g\ABC Email\Exported\JLB 2008-06-24\Chron - extracted\ABC
Estate_ Contact information.eml

Also annoying is the fact that even if the Excel source document has
active hyperlinks in a field, the merge of this field will transfer
only as text, not as an active hyperlink. So a separate field in
Excel has to be created with the path and file name with double \\ to
generate the \ separators, and use that as the source rather than the
hyperlink itself.

References:
http://homepage.swissonline.ch/cindy...r/MergFram.htm
http://www.gmayor.com/formatting_word_fields.htm




  #12   Report Post  
Posted to microsoft.public.word.mailmerge.fields
FUBARinSFO[_2_] FUBARinSFO[_2_] is offline
external usenet poster
 
Posts: 18
Default Can't set display text for hyperlink created in merged Word docfrom Excel data source

On Jun 28, 12:32*am, "Peter Jamieson"
wrote:
BTW by using this technique you really ought to be able to avoid the probem
of having a separate field with the doubled-up backslashes, by e.g. using
replace() in VBA to replace single backslashes in the field values.


Peter:

Good point, one that I hadn't thought of. Once you go to VBA (as
here) you open up new possibilities. Sometimes when it's a push to
deliver you go with what's visible even if it's a kludge, as mine is
here. I hate having the two different fields in the source Excel
file, the second one for the double '\\' required by Word. But I'm
leaving it on this pass to remind me that Word requires it, rather
than making the adjustment in the Word VBA itself. Otherwise, the
links will fail if I use them manually or in another context without
VBA, as I might do. But your suggestion is very helpful, and is yet
another impedance mismatch among the various Office components that we
shouldn't have to worry about.

-- Roy
  #13   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Can't set display text for hyperlink created in merged Word doc from Excel data source

Understood.


and is yet
another impedance mismatch among the various Office components that we
shouldn't have to worry about.


I agree. In this case, I have seen the argument that "\" is used as an
escape character, but as far as Word is concerned, it should not need to be.
This stuff worked differently in (much) earlier versions of Word and I've
always assumed that this is either a direct consequence of using C/C++
programming conventions to handle strings, or a consequence of a deigner
deciding that "escaping" was necessary and why not use an established
convention? But I really do not know.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"FUBARinSFO" wrote in message
...
On Jun 28, 12:32 am, "Peter Jamieson"
wrote:
BTW by using this technique you really ought to be able to avoid the
probem
of having a separate field with the doubled-up backslashes, by e.g. using
replace() in VBA to replace single backslashes in the field values.


Peter:

Good point, one that I hadn't thought of. Once you go to VBA (as
here) you open up new possibilities. Sometimes when it's a push to
deliver you go with what's visible even if it's a kludge, as mine is
here. I hate having the two different fields in the source Excel
file, the second one for the double '\\' required by Word. But I'm
leaving it on this pass to remind me that Word requires it, rather
than making the adjustment in the Word VBA itself. Otherwise, the
links will fail if I use them manually or in another context without
VBA, as I might do. But your suggestion is very helpful, and is yet
another impedance mismatch among the various Office components that we
shouldn't have to worry about.

-- Roy

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date fields are merged incorrectly when I use an Excel data source Jemdlee Mailmerge 4 May 30th 07 12:56 PM
Not all the data from my data source appears in my merged documen Marseldav Mailmerge 0 May 29th 07 05:13 PM
how to keep date format in merged document same as in data source clivedaniels Microsoft Word Help 1 October 5th 06 06:52 AM
how do i include data source into merged document? Jason Mailmerge 2 January 27th 06 08:02 AM
Merged data that is present in data source is missing in merge mbd_newjersey Mailmerge 1 December 17th 04 10:52 AM


All times are GMT +1. The time now is 07:58 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"