![]() |
#1
|
|||
|
|||
![]()
I would like there to be a tab between the footnote reference and the footnote text embedded in the Word Style so that the footnote looks like the picture attached.
I created the attachment manually and have not found a way to include it as a inbuilt Word Style. |
#2
|
||||
|
||||
![]()
Word doesn't provide a simple way to do this. You will have to "intervene" by using a couple of macros.
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
#3
|
||||
|
||||
![]()
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. |
#4
|
||||
|
||||
![]()
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 |
#5
|
||||
|
||||
![]()
Yes, you can intercept any built-in Word command.
Display the Visual Basic Editor by pressing Alt+F11 (or Alt+Fn+F11 on some keyboards). On the main menu, click View > Project Explorer (if necessary). Click the Normal project (which is a representation of the Normal template). Add a new Module from the Insert menu. Paste in the code from my previous message. Click the Save icon.
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
#6
|
||||
|
||||
![]()
Thank you.
But where would you advise me to go to learn on all built-in Word command end events like when a doc is opened? Thank you |
#7
|
||||
|
||||
![]()
For a list of commands, open the Macros dialog box (press Alt+F8 or Alt+Fn+F8) and choose the "Word commands" category for "Macros in."
Note that it might be a bit trickier to find out which command you need to intercept for a given task.
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
#8
|
||||
|
||||
![]()
Thank you very much for the info. I also learned that if you type: ctrl + alt + (the plus key on the number pad) the cursor changes to a clover and whatever menu you choose you will get the command that it executes.
Regarding the macro you wrote of hanging footnotes: Could this handle: 1. Asking the user what character should be on the left of the FN referer (something like the open parentheses char( and what char should be on the right of the referer, like the close parentheses) or [ ] and then insert the FN referer with those chars and then in the FN area open a footnote with the FN "referee" also within those chars. I know this can be done by finding anf replace after the fact but having this in real-time would be totally cooooooooool. I know you and others have better things to do than write code for a lazy gall like myself, but if you have an extra few minutes to do it I would be most appreciative! Thank you and have a good day! Susan Flamingo |
#9
|
||||
|
||||
![]()
You should post this a new question.
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
![]() |
|
![]() |
||||
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 |