Accessing Footnote Numbers in a Macro

Written by Allen Wyatt (last updated May 6, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365


Francesca is writing a macro that she will use to format the footnote numbers in a document and in the actual footnotes. If, for instance, she wants to make the footnote numbers (in both places) bold and red, she wonders how to do that.

There is actually an easier way to do this than with a macro. Before getting to that, however, let's look at the way you would do it if you choose to use a macro. The following is one approach to doing the formatting:

Sub FormatFootnoteNumbers()
    Dim i As Long
    Dim rngFootnote As Range
    Dim rngText As Range

    'Set variables
    For i = 1 To ActiveDocument.Footnotes.Count
        Set rngFootnote = ActiveDocument.Footnotes(i).Reference
        Set rngText = rngFootnote.Range
        'Format footnote number
        rngText.Font.Bold = True
        rngText.Font.Color = RGB(255, 0, 0)
    Next i
End Sub

The macro steps through each footnote, sets rngText to the appropriate reference text, and then makes it bold and red. The macro runs very quickly, and will need to be re-run whenever you add any new footnotes to your document.

Now, for the non-macro approach—rely on styles. Whenever you insert a footnote into your document, Word automatically formats the footnote references—both within the main document and within the footnotes themselves—using the Footnote Reference style. Thus, if you want the footnote references to look different, just modify the style used to format them. Follow these steps:

  1. Display the Styles task pane. (Display the Home tab of the ribbon and click the small icon at the bottom-right of the Styles group.)
  2. Within your document, select a footnote reference. You should see, at the top of the Styles task pane, that the Current Style is set to Footnote Reference.
  3. Hover the mouse pointer over the Current Style within the Styles task pane. You should see a down-arrow appear at the right of the Footnote Reference style.
  4. Click the down-arrow. From the resulting choices, choose Modify Style. Word displays the Modify Style dialog box.
  5. Change the settings in the dialog box, as desired. In Francesca's case, she should choose to make the font red and bold.
  6. Click on OK to close the Modify Style dialog box.

At this point, all of the footnote references in the document are updated to match the changes made in step 5. And, if you insert any additional footnotes in your document, they reflect the desired Footnote Reference style, as well.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (10528) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Converting WordPerfect Labels to Word

If you are relatively new to Word from the WordPerfect world, you may have a bunch of labels in a WordPerfect document ...

Discover More

Declaring Variables

Macros depend on the use of variables to do their work. This tip examines how variables are declared in a macro, using ...

Discover More

Reversing Cell Contents

Macros are great at working with text. This tip presents an example that shows this versatility by reversing the contents ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Removing Spaces before Footnote References

If you need to remove a space before a footnote reference, doing so may seem an impossible task. However, you can use two ...

Discover More

Converting Hyperlinks to Footnotes

If you have a document that contains a lot of active hyperlinks, you can use a macro to convert those hyperlinks to ...

Discover More

Copying and Moving Footnotes and Endnotes

If you need to move footnotes or endnotes from one location to another in a document, you can use editing techniques you ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 - 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.