I got a great macro for inserting the page number to the beginning of an MS Word endnote here:
Sub InsertPageNumberForEndnotes()
Dim endNoteCount As Integer
Dim curPageNumber As Integer
If ActiveDocument.Endnotes.Count > 0 Then
For endNoteCount = 1 To ActiveDocument.Endnotes.Count
Selection.GoTo What:=wdGoToEndnote, Which:=wdGoToAbsolute, _
Count:=endNoteCount
curPageNumber = Selection.Information(wdActiveEndPageNumber)
ActiveDocument.Endnotes(endNoteCount).Range.Select
ActiveDocument.Application.Selection.Collapse _
(WdCollapseDirection.wdCollapseStart)
ActiveDocument.Application.Selection.Paragraphs(1).Range.Characters(3)._
InsertBefore "Page " & CStr(curPageNumber) & ". "
Next
End If
End Sub
Which processes the endnotes from
^1 Blah blah blah
^2 Blah blah blah
^3 Blah blah blah
Into
^1 Page 2. Blah blah blah
^2 Page 23. Blah blah blah
^3 Page 119. Blah blah blah
I now need a second macro to "undo" the changes by removing the "Page nn - " so I can rerun the macro to refresh the page numbers. My thinking is I need to select the first 3 words each end note that begins with "Page", or maybe select the range up to the index of the first "-" character? What change would I need to the above macro to select and delete the text added?