B
bob adler
Following my query in Document Management newsgroup, Doug
Robbins offered this good macro to unembed endnotes and
to change the number preceding each endnote from
superscript to regular font:
Dim aendnote As Endnote
For Each aendnote In ActiveDocument.Endnotes
ActiveDocument.Range.InsertAfter vbCr &
aendnote.Index & ". " & aendnote.Range
aendnote.Reference.InsertBefore "a" &
aendnote.Index & "a"
Next aendnote
For Each aendnote In ActiveDocument.Endnotes
aendnote.Reference.Delete
Next aendnote
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Superscript = True
End With
With Selection.Find
.Text = "(a)([0-9]{1,})(a)"
.Replacement.Text = "\2"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
It works but there is an unintended result of the macro:
It not only removes the superscript format from the
number preceding the endnote, it removes all the
formatting (italics, etc.)from within the endnotes
themselves.
Can the macro be modified to remove just the superscript
formatting of the number preceding each endnote while
leaving the formating in the endnote itself, while
unembedding the endnotes?
Thanks,
bob adler
Robbins offered this good macro to unembed endnotes and
to change the number preceding each endnote from
superscript to regular font:
Dim aendnote As Endnote
For Each aendnote In ActiveDocument.Endnotes
ActiveDocument.Range.InsertAfter vbCr &
aendnote.Index & ". " & aendnote.Range
aendnote.Reference.InsertBefore "a" &
aendnote.Index & "a"
Next aendnote
For Each aendnote In ActiveDocument.Endnotes
aendnote.Reference.Delete
Next aendnote
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Superscript = True
End With
With Selection.Find
.Text = "(a)([0-9]{1,})(a)"
.Replacement.Text = "\2"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
It works but there is an unintended result of the macro:
It not only removes the superscript format from the
number preceding the endnote, it removes all the
formatting (italics, etc.)from within the endnotes
themselves.
Can the macro be modified to remove just the superscript
formatting of the number preceding each endnote while
leaving the formating in the endnote itself, while
unembedding the endnotes?
Thanks,
bob adler