I want to make some modification to the footnotes in a selected portion of a MS Word document. I would like to use a 'for each footnote in selection.footnotes', but this does not work. It returns all the footnotes in the document. I do not understand why, because if I run a 'selection.footnotes.count' this returns only the footnotes in the selected portion, which is what I want. See this code, which can be used for testing the problem.
For example: type a number of lines in Word, insert some footnotes in each line, select one of the lines and run this code to see the difference. Does anyone know what is wrong with my use of the For each footnote ...' statement?
For Each Footnote In Selection.Footnotes
i = i + 1
Next Footnote
MsgBox "• For ... Next: " & i & Chr(13) & _
"• Count: " & Selection.Footnotes.Count, vbOKOnly, "Number of footnotes in selection, counted using:"