![]() |
|
#1
|
|||
|
|||
|
I have been given quite a few 200 page contract documents to house style/format each containing over 300 footnotes. I recorded a find and replace to move the punctuation before the footnotes refs - but when I added code to remove spaces before footnotes refs it stopped working.
Code:
.text = "([.,:;\?\!])(^2)" What have I missed from the code to make it work correctly. Capture.PNG Code:
Sub MoveFootnotesBeforePunctuation()
Dim oRng As Range, oFN As Footnote
For Each oFN In ActiveDocument.Footnotes 'Remove spaces before footnote refs
Do While oFN.Reference.Characters.First.Previous Like "[" & Chr(32) + Chr(160) & "]"
oFN.Reference.Characters.First.Previous.Delete
Loop
Next
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.text = "([.,:;\?\!])(^2)" 'Move footnote refs before punctuation
.Replacement.text = "\2\1"
.text = "([\]])(^2)(^13)" 'Move footnote refs before square brackets end of paras
.Replacement.text = "\2\1\3"
.text = "([.;:])([\]])(^2)(^13)" 'Move footnote refs before square brackets and punctuation
.Replacement.text = "\3\2\1\4"
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End With
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Footnote references in the footnote section losing their style when cut+pasted from same doc
|
emblaw | Word | 4 | 12-08-2020 06:23 AM |
Fix footnote and endnote references to arabic numbers everywhere?
|
KDuncan | Word | 6 | 04-28-2020 12:14 AM |
Word Find won't move out of footnote
|
michaelbriordan | Word | 3 | 06-17-2015 10:12 AM |
How do I keep footnote references and text on the same page
|
bearligirl89 | Word | 3 | 11-20-2013 03:33 PM |
Multiple footnote references
|
jimgard | Word | 1 | 07-23-2013 11:47 AM |