How can I select all the footnotes reference in current page in Word VBA
- To post as a guest, your comment is unpublished.· 2 years agoHi hadi,
Sorry can help you with that. Thank you for your comment.
Normally, when selecting the whole Word document with Ctrl + A keys, all footnotes will be excluded from the selection. If you just want to select all footnotes in the document, how can you do? This article provides three methods for you to solve this problem.
You can use the hotkey Ctrl + A to select all footnotes at once in a Word document. Please do as follows.
Click to put your cursor at any footnote of your document, press the Alt + A keys simultaneously, then all footnotes in current document are selected immediately.
The Select Text with Similar Formatting feature can help to select all footnotes in a document.
1. Click to put your cursor at any footnote of your document.
2. In the Home tab, click Select > Select All Text With Similar Formatting. See screenshot:
Then all footnotes in current document are selected immediately.
The following VBA code can also help to select all footnotes in a document at the same time. Please do as follows.
1. In the document you will select all footnotes, press the Alt + F11 keys to open the Microsoft Visual basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, click Insert > Module, then copy below VBA code into the Module window. See screenshot:
VBA code: Select all footnotes in a Word document
Sub SelectAllFootnoteTexts() Dim xDoc As Document Dim xRange As Range Set xDoc = ActiveDocument If xDoc.Footnotes.Count > 0 Then Set xRange = xDoc.Footnotes(1).Range xRange.WholeStory xRange.Select End If End Sub
3. Then press the F5 key to run this code. All footnotes in current document are selected at once.