Ask Your Question

how to select all footnotes with a macro?

asked 2020-07-16 01:29:32 +0200

fabiobaq gravatar image

Consider you received a word savagely formatted document, and you have to clean it. Footnotes are styled as various different paragraph styles. You need to select them all and apply the footnote paragraph style. Solutions using "Alternative find & replace" extension don't help, as they depend on the correct paragraph styling to work. I guess it should be extremely easy to write a macro to do so, but I don't have a clue (I'm a designer, not a programmer). I record some macros, but as there is no "select all footnotes" command, I'm helpless. Can anyone assist me?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-07-16 22:01:23 +0200

Jim K gravatar image

updated 2020-07-16 22:22:10 +0200

AltSearch can do this, as explained in the help.

Using [::Footnote::]\\ with the button [ Find all ], the text of all FNs will be selected (handy for assigning a paragraph style to all FNs at once)

Your question states that this didn't work for you because it "depend[s] on the correct paragraph styling," but I don't see why, because it works no matter what the paragraph style is.

If for some reason that doesn't work, the following code from Listing 7.24 of Andrew's Macro Document gives an idea of how to work with footnotes.

If fnotes.hasElements() Then
    For nfnotes=0 To fnotes.getCount()-1

Since you are "a designer, not a programmer," this is probably not something you want to try. So you may want to find someone who can write the macro for you.

Or, unzip the .odt file and edit content.xml with a good text editor, possibly using regular expressions. When you are finished making the corrections, zip the file back up again.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-07-16 01:29:32 +0200

Seen: 37 times

Last updated: Jul 16