View Single Post
 
Old 10-29-2014, 03:25 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try replacing the code you posted with:
Code:
ActiveWindow.View.ShowFieldCodes = True
With Selection
  ' URL
  ActiveDocument.Hyperlinks.Add Anchor:=.Range, Address:="|", TextToDisplay:="Print Item"
  .Move Unit:=wdCharacter, Count:=-4
  .End = .End + 1
  ActiveDocument.MailMerge.Fields.Add Range:=.Range, Name:="Website_URL"
  .EndKey Unit:=wdLine
  .TypeText " / "
  .EndKey Unit:=wdLine
  ' TEXT LINK URL
  ActiveDocument.Hyperlinks.Add Anchor:=.Range, Address:="|", TextToDisplay:="Text Link"
  .Move Unit:=wdCharacter, Count:=-4
  .End = .End + 1
  ActiveDocument.MailMerge.Fields.Add Range:=.Range, Name:="Text_Link"
End With
ActiveDocument.Fields.Update
ActiveWindow.View.ShowFieldCodes = False
Note: This should also obviate the need for the macro I posted before.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote