#16
|
|||
|
|||
Question about macro
Thanks so much for posting this. I have been searching for weeks for just such a solution. I'm submitting a book to a publisher and am required to put the endnotes into a separate file, and I couldn't figure out how to cut them and paste them into a new document.
Could I trouble you for more advice on this -- how do I change the format of the detached endnotes? That is, could I change them so that they are formatted as: 1. Smith. [2 spaces between the '.' and 'Smith'] Rather than the following that the macro generates: 1 Smith. Thanks in advance! Alan Barenberg |
#17
|
||||
|
||||
Hi Alan,
With the first macro I posted, it's as simple as changing: .Text = i to: .Text = i & ". "
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#18
|
|||
|
|||
Working with endnotes
I've been rattling every cage I can find for some help in copying endnotes in Word for Mac 2011. Stephan Bloom was a big help in getting me through the first step but now the second step is eluding me.
What I want to do is copy the endnotes from a chapter to a separate document and remove them from the original while retaining the superscript numbers in the original and providing a corresponding number in the deleted/copied.moved endnotes. Word will not let me simply copy endnotes. An error message pops up saying it is an invalid action. The macro Bloom sent resolves part of the problem. It removes the superscripts from the endnotes and replaces them with regular numbers which can then be copied to a new document. The problem is the revised list looks like this: 1 Now is the time ... My aim is to make it look like this: 1. Now is the time ... 2. For all good men ... And so on through the list of footnotes. Does anyone have any idea how to create a macro to do this? The second problem is the Bloom macro replaces all the superscripted references. Where before it looked like this: Now is the time(superscript 1) It comes out like this: Now is the timea1a... That means going through the entire document and replace the "a...a" with the appropriate superscript. I think I I've found a workaround here,. if I work in Master Document mode the document appears as the original with all the endnote references in place and properly superscripted. It also removes the endnotes. I've only tried this with a couple of documents but it is encouraging. The problem remains with formatting the copied endnotes. Any and all help would be appreciated. |
#19
|
||||
|
||||
Hi Ken,
I've posted four macros for you to try in this (merged) thread. Except for some comments re the first one, I've never had any feedback from you as to whether they worked and, if not, what the issue was.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#20
|
|||
|
|||
Quote:
Maybe I missed some, but I've seen only two. My email referred to the first one which begins: Sub ExtractEndNotes() Application.ScreenUpdating = False Dim Rng As Range, i As Long, Doc As Document With ActiveDocument I tried the second one but it generated an error message saying something to the effect that it was not working and needed to be debugged. I let the debugger run for quite a long time, but it never produced any results. I'm far from an expert and I have no idea how to perform a debugging process except to let the process run. I'd be delighted to re-try any of your suggestions and promptly report the results. Ken |
#21
|
||||
|
||||
If you get a 'debug' error, note what the error message says and, when you press 'debug', which code line is highlighted. If you report those details, we may be able to deal with whatever the issue is.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#22
|
|||
|
|||
Paul
This is the macro I'm trying to run: Code:
Sub test() 'Macro created 29/09/99 by Doug Robbins to replace endnotes with textnotes at end of document ' and 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 End Sub Run time error '4605' This method or property is not available because the object spans a frame or note boundary Note that macro was written in 1999, which was long before Word for Mac 2011. But what it wants to accomplish is exactly what I'm trying to do. I very much appreciate your time. Ken Last edited by macropod; 09-14-2012 at 04:05 PM. Reason: Added code tags & formatting |
#23
|
||||
|
||||
We know about the problems with Doug's code, which is why I've posted four different macros for you to try. It appears you've only ever tried the first one. The code in post #15 (https://www.msofficeforums.com/word/...html#post28578), especially, shouldn't generate any of those errors.
Of course, without knowing exactly what's in your endnotes, it's possible the error is because there's, say, a frame in one of them - as suggested by the error message.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing footnotes to endnotes | Sarah | Word | 3 | 04-27-2017 08:55 PM |
Copying endnotes | kenglade | Word | 4 | 12-03-2011 01:26 PM |
Index entries in endnotes | perhj | Word | 0 | 06-19-2011 09:28 AM |
how do I change fonts for endnotes of word 2007? | Brent | Word | 5 | 02-01-2011 03:15 PM |
Separating accounts | aka252 | Outlook | 0 | 02-23-2006 07:55 PM |