Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 02-17-2018, 03:28 PM
macropod's Avatar
macropod macropod is offline How to extract selected hyperlink address to clipboard? Windows 7 64bit How to extract selected hyperlink address to clipboard? 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
 



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