Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2019, 06:56 AM
FLAYYMz FLAYYMz is offline Copy footnotes into text - with hyperlinks and framing characters Windows 10 Copy footnotes into text - with hyperlinks and framing characters Office 2019
Novice
Copy footnotes into text - with hyperlinks and framing characters
 
Join Date: Nov 2019
Posts: 2
FLAYYMz is on a distinguished road
Default Copy footnotes into text - with hyperlinks and framing characters

Hello!




I've found a number of macro's which copy the text of footnotes into the body text. However, I haven't been able to find a macro that does this for all footnotes in the document, while retaining the hyperlinks.


For instance, this works well, but with hyperlinks being lost:


Code:
Sub AddFnTextInBodyOfDoc()
Dim f As Footnote
Dim r As Range

For Each f In ActiveDocument.Footnotes
Set r = f.Reference
r.Collapse wdCollapseEnd
r.InsertAfter "$%" & f.Range.Text & "%$"

Next f
End Sub

Any help would be much appreciated!
Reply With Quote
  #2  
Old 11-25-2019, 02:57 PM
Guessed's Avatar
Guessed Guessed is offline Copy footnotes into text - with hyperlinks and framing characters Windows 10 Copy footnotes into text - with hyperlinks and framing characters Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

.InsertAfter deals with strings not formatted text so you can't use that. Try this instead
Code:
Sub AddFnTextInBodyOfDoc()
  Dim f As Footnote, r As Range
  For Each f In ActiveDocument.Footnotes
    Set r = f.Reference
    r.Collapse wdCollapseEnd
    r.InsertAfter "$%%$"
    r.Collapse wdCollapseStart
    r.MoveStart Unit:=wdCharacter, Count:=2
    r.FormattedText = f.Range.FormattedText
  Next f
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 11-25-2019, 06:27 PM
FLAYYMz FLAYYMz is offline Copy footnotes into text - with hyperlinks and framing characters Windows 10 Copy footnotes into text - with hyperlinks and framing characters Office 2019
Novice
Copy footnotes into text - with hyperlinks and framing characters
 
Join Date: Nov 2019
Posts: 2
FLAYYMz is on a distinguished road
Default

I can't thank you enough! That worked perfectly.


Thank you for your kindness. Have a great day
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy footnotes into text - with hyperlinks and framing characters Macro which finds hyperlinks and replaces them as footnotes rabauck Word VBA 11 10-21-2022 03:55 PM
Copy footnotes into text - with hyperlinks and framing characters Copy data if the Cell A1 has 4 characters in total LearnerExcel Excel 1 05-31-2018 05:33 PM
creating manuscript w/footnotes from separate documents containing chapters with footnotes-word 2010 Dottie Publisher 0 02-19-2017 03:18 PM
word 2016 printed footnotes do not restart as does digital copy bhavard Word 8 03-26-2016 12:37 PM
Copy footnotes into text - with hyperlinks and framing characters VBA to copy bookmark-hyperlinks to plain text strings Marrick13 Word 2 04-29-2012 05:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:58 PM.


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