Convert footnotes to ordinary text

  • Thread starter Fredrik E. Nilsen
  • Start date
F

Fredrik E. Nilsen

Hello,

I have a large document with several hundred footnotes. I'm looking
for a code to replace the footnote reference with the actual footnote
text. Any ideas on where to start?
 
S

Shauna Kelly

Hi Fredrik

The following should get you started:

Sub ReplaceFootnotesWithTheirText()

Dim nCounter As Long
Dim fn As Word.Footnote
Dim rngFN As Word.Range

For nCounter = ActiveDocument.Footnotes.Count To 1 Step -1
'Get a reference to our footnote
Set fn = ActiveDocument.Footnotes(nCounter)

'Work out where to copy the text
Set rngFN = fn.Reference
rngFN.Collapse wdCollapseEnd

'Copy the text of the footnote into the body of the document
rngFN.FormattedText = fn.Range.FormattedText

'Delete the footnote
fn.Delete

Next nCounter

End Sub


Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
F

Fredrik

Not only did it get me started, it worked like a charm right out of
the box. Thanks a lot!
 
R

Raul Garcia

Thank you very much, Shauna. I had been looking for a script like this. I do have an additional question, though.
How could I keep the reference numbers (or letters) instead of deleting them, and enclose the formatted footnotes, say, in angle brackets or some other symbol, to make them stand out in the body of the text?

Thanks so much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top