View Single Post
 
Old 02-16-2018, 09:48 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Unless I am missing something here (it wouldn't be the first time) why not use the hyperlink address property? e.g.

Code:
Sub GetLinkAddress()
Dim dFname As DataObject
Dim hLink As Hyperlink
    Set hLink = Selection.Hyperlinks(1)
    Set dFname = New DataObject
    dFname.SetText hLink.Address
    dFname.PutInClipboard
    MsgBox hLink.Address & vbCr & "copied to clipboard"
lbl_Exit:
    Set hLink = Nothing
    Set dFname = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote