I devised this macro to replace a hard return with a dash in the text of a footnote. Sometimes it works correctly, but sometimes it gives an error as if it tried to replace also footnote ending paragraphs. Any idea? Thanks!
Code:
Sub ReplRefNrWithinFootnote()
'Replaces with dash paragraph mark in the text of a footnote
Set parRng = ActiveDocument.StoryRanges(wdFootnotesStory)
With parRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Text = (Chr(13)) & "([!^02])" 'avoid ref. numbers
.Execute
While .Execute
parRng.Text = Replace(parRng.Text, Chr(13), " " & Chr(150) & " ")
Wend
End With
End Sub