Footnote Reference style lost

jmt356
SilverLounger
Posts: 2389
Joined: 28 Mar 2010, 01:49

Footnote Reference style lost

Post by jmt356 »

I was working in a very long Word document when suddenly, without warning, all of my styles changed. Text in Body Text and other styles changed to Normal or Comment Text. I now have over 240 footnote numbers that are in the Normal style rather than Footnote Reference. Is there a way to select all of the footnotes and apply the Footnote Reference style to them so that they are raised in superscript, or do I need to select each of them manually and apply the Footnote Reference style to them?
Regards,

JMT

User avatar
HansV
Administrator
Posts: 78524
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Footnote Reference style lost

Post by HansV »

Can't you Undo the changes? Or go back to a recent backup version?
Best wishes,
Hans

jmt356
SilverLounger
Posts: 2389
Joined: 28 Mar 2010, 01:49

Re: Footnote Reference style lost

Post by jmt356 »

ctrl + z does nothing.

I will see if I can go to another version. However, I have about an hour of work I have been doing that I will lose if I revert to an earlier version.
Regards,

JMT

User avatar
SpeakEasy
4StarLounger
Posts: 559
Joined: 27 Jun 2021, 10:46

Re: Footnote Reference style lost

Post by SpeakEasy »

Try running the following macro:

Code: Select all

Sub ResetFootnotes()
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "^f"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Style = ActiveDocument.Styles("Footnote Reference")
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub

snb
4StarLounger
Posts: 582
Joined: 14 Nov 2012, 16:06

Re: Footnote Reference style lost

Post by snb »

Shouldn't you apply this macro to

Code: Select all

ThisDocument.StoryRanges(wdPrimaryFooterStory)
ThisDocument.StoryRanges(9)

User avatar
SpeakEasy
4StarLounger
Posts: 559
Joined: 27 Jun 2021, 10:46

Re: Footnote Reference style lost

Post by SpeakEasy »

I was assuming OP would select the ranges he wants the fix applied to. But sure, if you want to fix it up in the actual footnotes themselves your code would be a useful addition

User avatar
BobH
UraniumLounger
Posts: 9293
Joined: 13 Feb 2010, 01:27
Location: Deep in the Heart of Texas

Re: Footnote Reference style lost

Post by BobH »

I've developed the practice of copying the new material - or all of it if there were mid-work edits - to a notepad until the blips are resolved. Then the text can be pasted into the newly resolved style when recovered in Word.

HTH
Bob's yer Uncle
(1/2)(1+√5)
Dell Intel Core i5 Laptop, 3570K,1.60 GHz, 8 GB RAM, Windows 11 64-bit, LibreOffice,and other bits and bobs

snb
4StarLounger
Posts: 582
Joined: 14 Nov 2012, 16:06

Re: Footnote Reference style lost

Post by snb »

A more object oriented approach could be:

Code: Select all

Sub M_snb()
  On Error Resume Next

  For Each it In ThisDocument.StoryRanges
   For Each it1 In it.Footnotes
     it1.Reference.Style = ThisDocument.Styles("Footnote Reference")
   Next
  Next
End Sub