How can I copy endnotes to a new document?

G

Guest

A manuscript has been created with seprate documents for each chapter. Each
of these documents has endnotes.

A publisher has requested that all the endnotes for each chapter be
separated into one document for publication at the end of the book.

Is there any way to copy just the endnotes from each chapter document into
one new endnote only document?
 
D

Daiya Mitchell

Use google to search the archives of these groups. Doug Robbins has created
some macros that will convert endnotes to plain text, which you could then
cut and paste as you like and have the numbers follow, so look for Doug
Robbins as the author, and try various keywords. I know the question has
come up a few times.

This link should search all Word-dedicated groups hosted by MS, though you
might need to add the .* at the end back, if the link broke.

http://groups.google.com/advanced_group_search?q=group:microsoft.public.word
..*
 
D

Doug Robbins

Here is the macro to which Daiya referred you. SAVE each document BEFORE
running it.

' Macro created 29/09/99 by Doug Robbins to replace endnotes with textnotes
at end of document and

' to replace the endnote reference in the body of the document with a
superscript number.

'

Dim aendnote As Endnote

For Each aendnote In ActiveDocument.Endnotes

ActiveDocument.Range.InsertAfter vbCr & aendnote.Index & vbTab &
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

--
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
 
D

Daiya Mitchell

Here is the macro to which Daiya referred you. SAVE each document BEFORE
running it.

Do you mean do a Save As and do this on a COPY? That's what I would do
anyhow, as these numbers will never update after running this and you may
someday need to go back to the original doc.
 
D

Doug Robbins

Or, Save, run the macro and then do the Save As.

--
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
 
G

Guest

Thanks for the help!

One more plea for assistance - Is there a good primer that you can point me
to for creating a macro like this one? I'm trying to "cut and paste" but
running into a bit of difficulty - getting "syntax errors" when I try to run
the macro.

Thanks again.
 
D

Daiya Mitchell

One more plea for assistance - Is there a good primer that you can point me
to for creating a macro like this one? I'm trying to "cut and paste" but
running into a bit of difficulty - getting "syntax errors" when I try to run
the macro.
Start here, if necessary:

What do I do with macros sent to me by other newsgroup readers to help me
out?
I don't know how to install them and put them to use
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

Then see if this info helps, once you have the macro in the Visual Basic
Editor:

Common Problems: All macros must start with a Sub statement and end with an
End Sub. If the code someone gave you already had the Sub/End Sub in it, you
will need to delete the extra Sub lines. It is conceivable that a
sophisticated piece of code may also contain Function() and End Function
statements: for the purposes of this article, treat them as equivalent.

Lines that show up in red have errors. This is most likely because there are
line breaks in the wrong place, since newsgroups and email can force shorter
line breaks. To fix these, place your cursor at the end of the first red
line, and start tapping Delete. When you delete all the invisible spaces and
carriage returns, the next line will move up and that may fix the problem.
Do not delete any visible characters. Be aware that the statement in red may
continue over three or four lines. You may need to re-enter a space that you
delete.

Laptop users: the delete key usually behaves as a backspace key. You could
also backspace from the beginning of the lines in red, to let the VBE wrap
the lines naturally.

And perhaps see also:

Guide to Installing Macros
http://www.gmayor.com/installing_macro.htm
 

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