Thread: [Solved] Corrupted footnotes in Word
View Single Post
 
Old 09-10-2012, 04:57 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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

Hi mythander889,

I've put together a macro for repairing footnote and endnote references (your attachment actually has endnotes, not footnotes) but, before you run it, I think you might have some other work to do. In developing the code, I noticed that one of the references kept duplicating lines on screen. This could be a sign of document corruption. Accordingly, I recommend that you:
• insert a paragraph break at the very end of the body of the document (not in the endnotes);
• copy & paste everything except the new paragraph break into a new document;
• close the old document and save the new one over it.
That is generally sufficient to fix document corruption.

You can then run the following macro.
Code:
Sub FixNoteRefs()
' Turn Off Screen Updating
Application.ScreenUpdating = False
Dim i As Long, RngRef As Range, StrLnk As String
With ActiveDocument
  ' Process all Footnotes
  For i = .Footnotes.Count To 1 Step -1
    Set RngRef = .Footnotes(i).Reference
    With .Footnotes(i)
      .Range.Cut
      .Delete
    End With
    ActiveDocument.Footnotes.Add Range:=RngRef
    .Footnotes(i).Range.Paste
  Next
  ' Process all Endnotes
  For i = .Endnotes.Count To 1 Step -1
    Set RngRef = .Endnotes(i).Reference
    With .Endnotes(i)
      .Range.Cut
      .Delete
    End With
    ActiveDocument.Endnotes.Add Range:=RngRef
    .Endnotes(i).Range.Paste
  Next
End With
' Cleanup
Set RngRef = Nothing
' Restore Screen Updating
Application.ScreenUpdating = True
End Sub
For installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm

The next issue to consider is whether the odd characters that show in the attachment to your first post are still in the document. They're not in your latest attachment and the process for repairing the hyperlinks, especially, is affected by whether those characters are still present. If you could clarify that point, we can make more progress there too. If those characters are no longer present, does the word 'Accessed' always appear after the hyperlink?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote