Quote:
Originally Posted by RobiNew
Is there a way to remove extra carriage returns in footnotes with a macro? Thanks!
|
Try this. I found in
Lyonizing Word: Deleting Extraneous Carriage Returns in Footnotes and Endnotes | An American Editor
Code:
Sub CleanReturnsInNotes()
NoteCount = ActiveDocument.Footnotes.Count
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute
On Error GoTo TrapTheError
While Selection.Find.Found
Selection.MoveLeft
Selection.Delete
Selection.Find.Execute
Wend
GoTo TheEnd
TrapTheError:
ErrorCount = ErrorCount + 1
Selection.MoveRight
Selection.Delete
If ErrorCount < NoteCount Then Resume Next
TheEnd:
End Sub