![]() |
|
#2
|
||||
|
||||
|
Since nearly all of the paragraphs in the footnotes are going to start with a footnote reference, a find replace is less useful. Try this variation
Code:
Sub BracketFootnotes()
Dim rg As Range, aPar As Paragraph, rngRef As Range
Set rg = ActiveDocument.Range
With rg.Find
.Format = True
.Style = ActiveDocument.Styles(wdStyleFootnoteReference)
.Wrap = wdFindStop
While .Execute
If rg.Characters(1) <> "(" Then
rg.InsertBefore "("
rg.InsertAfter ")"
rg.Style = ActiveDocument.Styles(wdStyleFootnoteReference)
End If
rg.Collapse wdCollapseEnd
Wend
End With
Set rg = Nothing
Set rg = ActiveDocument.StoryRanges(wdFootnotesStory)
For Each aPar In rg.Paragraphs
Set rngRef = aPar.Range.Words.First
rngRef.End = rngRef.Start + Len(Trim(rngRef.Text))
rngRef.Select
If rngRef.Characters.First.Style = "Footnote Reference" And rngRef.Characters.First <> "(" Then
rngRef.InsertBefore "("
rngRef.InsertAfter ")"
rngRef.Style = wdStyleFootnoteReference
End If
Next aPar
Set rg = Nothing
Set rngRef = Nothing
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Normal dot not working properly
|
John9210 | Word | 13 | 02-12-2018 07:50 AM |
| Vlookup Not working Properly | josepfh | Excel | 1 | 04-19-2017 11:04 AM |
| It seems as if wdFindStop isn't working properly | tfurnivall | Word VBA | 3 | 05-06-2016 09:58 AM |
Indentation Not Working Properly
|
LaC0saNostra | Word | 2 | 02-01-2015 11:35 AM |
| Word 2000 Macro not working properly | brianlb | Word VBA | 1 | 07-01-2009 07:04 AM |