Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-18-2024, 12:36 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Footnote style Windows 11 Footnote style Office 2021
Moderator
 
Join Date: Aug 2011
Posts: 4,008
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

You can set a hanging indent for your Footnote Text style and then add the following pair of macros to your Normal.dotm:

Sub InsertFootnote()
'Codefrom wordmvp.com, modified by Stefan Blom
ActiveDocument.Footnotes.Add Range:=Selection.Range

With Selection
.Paragraphs(1).Range.Font.Reset
.Paragraphs(1).Range.Characters(2) = ""
.InsertAfter "." & vbTab
.Collapse wdCollapseEnd
End With
ActiveWindow.ScrollIntoView Selection.Range



End Sub

Sub InsertFootnoteNow()
'Code from wordmvp.com, modified by Stefan Blom
ActiveDocument.Footnotes.Add Range:=Selection.Range

With Selection
.Paragraphs(1).Range.Font.Reset
.Paragraphs(1).Range.Characters(2) = ""
.InsertAfter "." & vbTab
.Collapse wdCollapseEnd
End With
ActiveWindow.ScrollIntoView Selection.Range
End Sub



The macros will override the built-in commands to add footnotes and run the code instead. They will apply to future footnotes that you create in Word.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional

Last edited by Stefan Blom; 02-19-2024 at 01:34 AM.
Reply With Quote
  #2  
Old 02-19-2024, 01:52 AM
RRB's Avatar
RRB RRB is offline Footnote style Windows 11 Footnote style Office 2021
Susan Flamingo
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 297
RRB is on a distinguished road
Default Footnote style

Are you saying that you can intercept built-in Word commands and customize their behavior?

So if I hit ctrl+alt+f (insert footnote) it will execute your code as opposed to the built in behavior?

Where are all the Word "events" documented, with their exact names? So if I want to run a macro that when a certain file opens you get a message box: "You better get working faster because you are falling behind", where can I learn about the file/open "event"?

Total Newbie to VBA/Word macros, please be patient and excuse my cosmic ignorance.

Thank you and have a good day!

Susan Flamingo
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Footnote style How to remove extra space between footnote separator and 1st footnote. No para breaks present. Swarup Word 2 07-09-2022 07:42 PM
Restarting footnote and endnote numbering? Can I have a style that starts a new section? RRB Word 3 10-14-2021 12:51 PM
Footnote style Changing the default footnote reference style: [1] RRB Word 2 06-10-2021 04:04 PM
Footnote style Footnote references in the footnote section losing their style when cut+pasted from same doc emblaw Word 4 12-08-2020 06:23 AM
Footnote style Is there a way programmatically to determine the footnote number style, if other than arabic numbers gn4619 Word VBA 2 11-23-2015 11:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft