Troubleshooting endnotes in Word

T

TBSC

The endnotes in my MS 2002 Word document are now out of order after deleting
one endnote and did not update. There appears to be a phantom reference in
the document where I deleted the old endnote and I can't delete it (there's
no reference number, just a blank window when I pass the cursor over this
location). I guess this is why the endnotes won't update. How do I update
this and get rid of the old reference?
 
D

Doug Robbins

Try the following macro on a copy of the document (or save it first)

' Macro created by Doug Robbins to re-insert Endnotes

Dim afnRange As Range, afntext As String, i As Integer

For i = 1 To ActiveDocument.Endnotes.Count

ActiveDocument.Endnotes(i).Reference.Select

Selection.Characters(1).Select

If Not Selection.Style = "Endnote Reference" Then

While Not Selection.Style = "Endnote Reference"

Selection.Collapse wdCollapseStart

Selection.MoveLeft wdCharacter

Selection.Characters(1).Select

Wend

Selection.Delete

End If

Set afnRange = ActiveDocument.Endnotes(i).Range

afntext = afnRange.Text

ActiveDocument.Endnotes(i).Delete

ActiveDocument.Endnotes.Add Range:=Selection.Range, Text:=afntext


Next i

It was originally written to re-insert footnotes and I just modified it for
endnotes, but have not tried it.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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