Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 10-21-2022, 03:55 PM
macropod's Avatar
macropod macropod is offline Macro which finds hyperlinks and replaces them as footnotes Windows 10 Macro which finds hyperlinks and replaces them as footnotes Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

The code in post #2 works as described. Unlike your requirements, though, it deletes the hyperlink's 'click' text. You can preserve that by changing:
Code:
.Range.Text = vbNullString
to:
Code:
.Range.FieldsUnlink
For just the active document, you could use:
Code:
Sub HLnk2FtNt()
Application.ScreenUpdating = False
Dim h As Long, Rng As Range
With ActiveDocument
  For h = .Hyperlinks.Count To 1 Step -1
    With .Hyperlinks(h)
      Set Rng = .Range
      With Rng
        .Collapse wdCollapseEnd
        .Footnotes.Add Rng
        .End = .End + 1
      End With
      Rng.Footnotes(1).Range.FormattedText = .Range.FormattedText
      .Range.Fields.Unlink
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
hyperlink, macro, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro which finds hyperlinks and replaces them as footnotes Word macro for selecting text and putting it in footnotes mdhg Word VBA 20 03-06-2024 08:07 AM
Macro which finds hyperlinks and replaces them as footnotes Is there a macro to convert superscripted endnotes to active footnotes? mediadesign Word VBA 4 08-20-2018 03:20 PM
creating manuscript w/footnotes from separate documents containing chapters with footnotes-word 2010 Dottie Publisher 0 02-19-2017 03:18 PM
Macro which finds hyperlinks and replaces them as footnotes How can I create a macro to shift the content of all subsequent footnotes up one position? Atfon Word VBA 4 03-29-2016 05:51 AM
Macro which finds hyperlinks and replaces them as footnotes Word doesn't jumps tothe next lane when finds the dash sign!!!! why? Jamal NUMAN Word 3 04-10-2011 02:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:50 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