Written by Allen Wyatt (last updated April 6, 2024)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365
Gary would like to process the information stored in footnotes using a macro. However, he cannot figure out how to do so. He wonders how to step through each footnote and access just the text of the footnote, not the footnote's number.
The key to accessing footnotes in VBA is to use the Footnotes collection, which contains all of the footnotes in the document. This means you can use a For...Each loop to step through each of your footnotes, in this manner:
Sub DoFootnotes() Dim fn As Footnote Dim sTemp As String For Each fn In ActiveDocument.Footnotes sTemp = fn.Range.Text ' ' Do something here based on contents of sTemp ' Next fn End Sub
Note that the value in the .Text property is the text of your footnote, and this macro code assigns that to the sTemp variable. You can then slice and dice sTemp in any way you want to do your processing. You can also, if desired, stuff information back into the .Text property to change the contents of the footnote.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13521) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365.
The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2019. Spend more time working and less time trying to figure it all out! Check out Word 2019 For Dummies today!
Editing a document can, at times, be hard work. It isn't made any easier if you feel that Word is "fighting" you on some ...
Discover MoreIf you've got a lot of short footnotes in a document, you might be looking for a way to save space by "crunching up" the ...
Discover MoreFootnotes can be handled many different ways in a document. If you want to restart the numbering of your footnotes every ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments