View Single Post
 
Old 02-17-2018, 03:28 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,340
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

Yes, that's a god alternative (better in some ways, as my code didn't address the presence of other field switches), but one still needed use the MS Forms 2.0 Object Library:
Code:
Sub CopyHyperlink()
Dim StrTxt As String
With Selection.Hyperlinks(1)
  StrTxt = .Address
  If .SubAddress <> "" Then StrTxt = StrTxt & "#" & .SubAddress
  With .Range.Fields(1).Code
    .Text = StrTxt
    .Copy
  End With
  ActiveDocument.Undo
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote