Consulting

Results 1 to 3 of 3

Thread: How to extract endnotes into the main story, retaining their position, formatting etc

  1. #1

    How to extract endnotes into the main story, retaining their position, formatting etc

    Has anyone out there got a macro that extracts endnotes and places them in the main story in such a way that when printing, the reader could not see any difference between the doc with endnotes and the doc with its endnotes extracted to the main doc.? The macro needs to:

    1. Place the endnote text where it would appear in the main text were it an actual Word endnote. In the original doc., endnotes can appear anywhere on a page, and always after a continuous section break. Endnote numbering should restart after every continuous section break, as in the original document.

    2. Leave a correctly numbered superscripted number in the main text.

    3. Retain formatting, italics, fonts, etc.

    The logic would/could probably be something like:

    1. Cycle through the doc. adding identical superscripted numbers alongside the genuine endnote reference numbers. Return to top of doc.
    2. Find next endnote. Add bookmark A after the endnote reference number
    3. Extract the endnote reference number to a variable
    4. Copy the endnote text to the clipboard
    5. Find the next section break, find Bookmark B if it exists
    6. Insert the endnote number and the endnote text, terminating with a new para. Add bookmark B after the inserted text
    7. Go back to bookmark A, delete it, and loop on 2
    8. When all done, delete all original endnotes, bookmarks and section breaks.

    If anyone already has code that does any or all of this, it would be much appreciated. I expect there are more elegant ways of doing it!

    The exercise is required for preparing an encyclopedic work for typesetting with Adobe InDesign. The typesetter tells me that there are issues when pouring a Word doc with endnotes into InDesign, when the endnotes do not appear all together at the end of an individual document. There are several thousand entries in this encyclopedia, many of which have endnotes. The alternative of splitting the document into thousands of numbered documents, each with its own endnotes, is not viable....

    Thanks
    Last edited by johndavidson; 01-21-2015 at 09:12 PM.

  2. #2
    A quick web search revealed a number of macros that might work for you - see for example - http://www.msofficeforums.com/word/1...ular-text.html
    Do however test on a copy of the document!
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    Thanks - looks promising. I'll check it out.

    Later ... that was painless! Needed a few minor mods for my local needs such as a different endnote style and the addition of a vbCr before the first and between all the endnotes. Seems to be working fine without loss of italics, special fonts etc.

    Marked as solved.
    Last edited by johndavidson; 01-22-2015 at 05:14 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •