Hiding certain footnote texts with VBA in a Word table
Posted on 2012-09-05
Using VBA with Word 2010, I have a table with some footnotes inside certain cells. The footnote texts appear at the bottom of the page.
From time to time I need to hide some rows in the table, which I do by moving those rows to the end of the table, selecting the rows, and setting the font to just 3 points, the font color to transparent, and the font hidden status to true. That seems far easier to do than to copy the rows and the footnotes into document variables and then restoring them, including formatting and footnotes, from the document variables.
With the method of hiding rows at the end and reformatting them to be “invisible,” the rows disappear, but the footnote texts from the hidden rows still appear at the bottom of the page.
If I could find out which footnotes are in the hidden rows at the end, I suppose I could use something like
ActiveDocument.Footnotes.Item(i).Reference.Font.Hidden = True
ActiveDocument.Footnotes.Item(i).Range.Font.Hidden = True
But how could I find the value of the “i" in the above lines?
Thanks for any suggestions.
j.r.a. in Priddis, Alberta