Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2022, 06:30 AM
ballpoint ballpoint is offline Converting hyperlinked endnotes to footnotes Windows 10 Converting hyperlinked endnotes to footnotes Office 2016
Advanced Beginner
Converting hyperlinked endnotes to footnotes
 
Join Date: Sep 2017
Posts: 42
ballpoint is on a distinguished road
Default Converting hyperlinked endnotes to footnotes

Hello,



I have a .doc document in which the endnotes are hyperlinks, I suspect, because the .doc has been generated from an html webpage.

I am trying to find a way to convert these to footnotes for further processing (but I know how to do that). I have tried this solution

Convert hyperlinks into footnotes on StackOverflow


However, it it does not work on this file, I suspect, because this might be indeed a different scenario. I am attaching a sample document which should explain what the problem is.

Thank you very much!

My apologies, I posted in the wrong forum by mistake: I would be grateful if the thread could be moved. Thanks.
Reply With Quote
  #2  
Old 01-05-2022, 10:16 AM
Charles Kenyon Charles Kenyon is offline Converting hyperlinked endnotes to footnotes Windows 10 Converting hyperlinked endnotes to footnotes Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,081
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

These are not Word endnotes. Word does not see them as endnotes at all. They were apparently prepared in a different program (perhaps Endnote?). Word does not have an automatic way of converting these. The source program might.

The hyperlinks refer back to places in the document.

It is possible that someone here will be able to give you a macro that converts these. I believe it to be beyond my skill level.

Otherwise, I would recommend doing it manually. Copy the content of each endnote into the clipboard. Then use the hyperlink to go to the source and insert a footnote, copying the old content. Then delete both the endnote reference in the text and the endnote.
Reply With Quote
  #3  
Old 01-05-2022, 10:24 AM
ballpoint ballpoint is offline Converting hyperlinked endnotes to footnotes Windows 10 Converting hyperlinked endnotes to footnotes Office 2016
Advanced Beginner
Converting hyperlinked endnotes to footnotes
 
Join Date: Sep 2017
Posts: 42
ballpoint is on a distinguished road
Default

Thanks! I appreciate your help with this. Unfortunately, I have 800+ documents where I would have to do this, so doing it manually might be a bit of a no go. I will have to figure out a way to deal with this with code, I suspect, although I now understand why the original vba solution I relied on did not work on this one.

Thanks again!
Reply With Quote
  #4  
Old 01-07-2022, 02:28 PM
macropod's Avatar
macropod macropod is offline Converting hyperlinked endnotes to footnotes Windows 10 Converting hyperlinked endnotes to footnotes Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Quote:
Originally Posted by ballpoint;164819I am trying to find a way to convert these to [I
footnotes[/I] for further processing (but I know how to do that).
Your 'footnotes' are a simple Word table, which makes it easy to extract the data for whatever 'further processing' you want. However, since you haven't said what that further processing might be, it's impossible for anyone to provide meaningful advice...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-07-2022, 02:34 PM
ballpoint ballpoint is offline Converting hyperlinked endnotes to footnotes Windows 10 Converting hyperlinked endnotes to footnotes Office 2016
Advanced Beginner
Converting hyperlinked endnotes to footnotes
 
Join Date: Sep 2017
Posts: 42
ballpoint is on a distinguished road
Default

Thanks! And sorry, I should have been clearer. My ultimate goal is to convert the endnotes into footnotes and then the footnotes into inline citations (but I do have some code—actually, *your* code!) to perform that task. But I do also find it useful to have a version of the document with actual footnotes so my goal would have been to process the files twice (once for the conversion to footnotes and once to get them into inline citations). Does this clarify the problem? Thanks again!
Reply With Quote
  #6  
Old 01-09-2022, 06:07 PM
macropod's Avatar
macropod macropod is offline Converting hyperlinked endnotes to footnotes Windows 10 Converting hyperlinked endnotes to footnotes Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Try the following code. Although you refer to footnotes, your content is more akin to endnotes - which is what the macro converts your content to.
Code:
Sub CreateEndNotes()
Application.ScreenUpdating = False
Dim Tbl As Table, r As Long, Hlnk As Hyperlink
Dim RngRef As Range, RngText As Range
With ActiveDocument
  .Endnotes.NumberStyle = wdNoteNumberStyleArabic
  Set Tbl = .Hyperlinks(.Hyperlinks.Count).Range.Tables(1)
  If Tbl Is Nothing Then Exit Sub
  With Tbl
    For r = .Rows.Count To 1 Step -1
      If .Cell(r, 1).Range.Hyperlinks.Count > 0 Then
        Set Hlnk = .Cell(r, 1).Range.Hyperlinks(1)
        Set RngText = Tbl.Cell(r, 2).Range
        With RngText
          .End = .End - 1
          Do While .Characters.Last = vbCr
            .End = .End - 1
          Loop
        End With
        Set RngRef = ActiveDocument.Bookmarks(Hlnk.SubAddress).Range
        With RngRef
          .End = .Paragraphs(1).Range.End
          .End = .Hyperlinks(1).Range.End
          .Text = vbNullString
        End With
        ActiveDocument.Endnotes.Add RngRef
        With RngRef
          .End = .End + 1
          .Endnotes(1).Range.FormattedText = RngText.FormattedText
        End With
      End If
    Next
    .Delete
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
footnotes, hyperlinks, vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting certain footnotes to endnotes Brainiac Word VBA 3 07-02-2019 04:31 AM
Converting hyperlinked endnotes to footnotes Footnotes / Endnotes? | See attachment modene1 Word 2 05-17-2017 02:53 AM
Changing footnotes to endnotes Sarah Word 3 04-27-2017 08:55 PM
Converting hyperlinked endnotes to footnotes Converting hard-entered endnotes to footnotes? New Daddy Word VBA 1 10-21-2012 02:51 PM
Converting hyperlinked endnotes to footnotes Endnotes within Footnotes? elias Word 12 09-04-2012 04:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:58 AM.


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