Thread: [Solved] VBA Footnote Issues
View Single Post
 
Old 11-01-2024, 08:18 AM
Shelley Lou Shelley Lou is offline Windows 10 Office 2016
Expert
 
Join Date: Dec 2020
Posts: 259
Shelley Lou is on a distinguished road
Default VBA Footnote Issues

I found the code below on another post that formats footnotes with a tab. I seem to be having a couple of issues in that it removes the bold format from the Footnote Reference number and applies bold to the Footnote Text. How can I get the code to reverse this so the Footnote Reference is bold but the Footnote Text is not bold? I've checked the styles for both of these in the Styles Pane and they are set correctly eg Footnote Reference set as bold and Footnote Text set as not bold. I've also set the Footnote Text in the Styles Pane to be indented at 0.25" but could this be added to the code itself?

Footnote Image.JPG

Code:
Sub InsertFootnote()
ActiveDocument.Footnotes.Add Range:=Selection.Range
With Selection
.Paragraphs(1).Range.Font.Reset
.Paragraphs(1).Range.Characters(2) = ""
.InsertAfter vbTab
.Font.Bold = True
.Collapse wdCollapseEnd
End With
ActiveWindow.ScrollIntoView Selection.Range
End Sub

 
Sub InsertFootnoteNow()
ActiveDocument.Footnotes.Add Range:=Selection.Range
With Selection
.Paragraphs(1).Range.Font.Reset
.Paragraphs(1).Range.Characters(2) = ""
.InsertAfter vbTab
.Font.Bold = True
.Collapse wdCollapseEnd
End With
ActiveWindow.ScrollIntoView Selection.Range
End Sub
Reply With Quote