Adding footnote number as part of footnote text – part deux
I had a footnote referencing text adaptation that Greg Maxey provided a macro for.
I wanted to add the footnote reference number as {Note 1}, {Note 2} between my footnote reference number and the footnote text – the number needed to be static so that it would retain the original footnote number even if new footnotes were added.
The macro worked great and is below.
I now have a new document where the footnotes contain a lot of formatted text such as italics, small caps and colored text along with the regular footnote text. The macro appears to extend the formatting of whatever the first character of the footnote text is through the remainder of the text and including the created {Note + fn#} so that I can end up with a footnote in all italics, all small caps or all red text., depending on the formatting of the first word.
This wasn’t an issue previously as the footnotes were all Times New Roman 10pt.
How can the macro be adapted to preserve the text as currently formatted but put the bracketed Note + number in Times New Roman 10pt before it?
Thanks for any help!
Option Explicit
Private m_oFN As Footnote
Sub ScratchMacro()
For Each m_oFN In ActiveDocument.Footnotes
m_oFN.Range.Text = "{Note " & fcnGetFootnoteReferenceIndex & "} " & m_oFN.Range.Text
Next
lbl_Exit:
Exit Sub
End Sub
Function fcnGetFootnoteReferenceIndex() As String
With m_oFN
With .Reference.Characters.First
.Collapse
.InsertCrossReference wdRefTypeFootnote, wdFootnoteNumberFormatted, m_oFN.Index
fcnGetFootnoteReferenceIndex = .Characters.First.Fields(1).Result
.Characters.Last.Fields(1).Delete
End With
End With
lbl_Exit:
Exit Function
End Function
|