View Single Post
 
Old 10-09-2018, 10:16 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
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

Based on your attachment, the following macro should be enough to repair the footnotes and their references. That said, your attachment seems to have other issues as well. For example, the body text has the 'Header' Style applied, but that's been completely overwritten with a different set of formatting.
Code:
Sub RepairFootnotes()
Application.ScreenUpdating = False
Dim FtNt As Footnote, Rng As Range
With ActiveDocument
  Application.OrganizerCopy Source:=.AttachedTemplate.FullName, _
    Destination:=.FullName, Name:=.Styles(wdStyleFootnoteReference).NameLocal, Object:=wdOrganizerObjectStyles
  Application.OrganizerCopy Source:=.AttachedTemplate.FullName, _
    Destination:=.FullName, Name:=.Styles(wdStyleFootnoteText).NameLocal, Object:=wdOrganizerObjectStyles
  For Each FtNt In .Footnotes
    With FtNt
      With .Reference
        Set Rng = .Duplicate
        Rng.Collapse wdCollapseStart
        Do While .Characters.Last.Next.Style <> wdStyleFootnoteReference
          Rng.FormattedText = .Characters.Last.Next.FormattedText
          Rng.Collapse wdCollapseEnd
          .Characters.Last.Next.Text = ""
        Loop
        .Characters.Last.Next.Text = ""
        FtNt.Reference.Style = wdStyleFootnoteReference
      End With
      With .Range
        .Style = wdStyleFootnoteText
        .Font.Reset
        .ParagraphFormat.Reset
        .Characters.First.Style = wdStyleFootnoteReference
      End With
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: Installing Macros
For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote