Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2018, 09:48 PM
gmayor's Avatar
gmayor gmayor is offline How to extract selected hyperlink address to clipboard? Windows 10 How to extract selected hyperlink address to clipboard? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract name and address. donlincolnmsof Word VBA 1 11-10-2017 12:59 PM
Add Hyperlink in Visio that when clicked copies something to your clipboard MoHyB Visio 0 11-10-2017 08:55 AM
How to extract selected hyperlink address to clipboard? Find & selected paras with highlighted text & copy to clipboard marceepoo Word VBA 1 09-14-2012 08:20 PM
How to extract selected boilerplate into a new doc mturner296 Word 0 03-29-2010 07:35 AM
How to extract selected hyperlink address to clipboard? Extract email address from field zssteen Excel 1 06-19-2009 02:32 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft