![]() |
|
#1
|
||||
|
||||
![]()
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. |
#2
|
||||
|
||||
![]()
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 |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |
![]() |
RRB | Word | 2 | 06-10-2021 04:04 PM |
![]() |
emblaw | Word | 4 | 12-08-2020 06:23 AM |
![]() |
gn4619 | Word VBA | 2 | 11-23-2015 11:00 PM |