Hi Vassilis:
It runs OK here. I need you to tell me exactly HOW it is failing for you.
What happens? I need the full details: this is weak code with no state or
error-checking so I need to know what's going wrong.
If you are complaining about the fact that it can't handle anything but
Arabic numbering, so am I
I am working on that problem, because everyone really wants the version that
can handle any kind of numbering.
Those who know VBA will tell you that's one of the things they "forgot": you
can't easily replicate numbers in VBA in the wide range of formats that
Endnotes support. This is made more interesting by the fact that the
EndNote Reference is "not" a "number", and it's "not" actually in the text
It's a pointer to a format. The thing that prints is inserted byWord
at output time. This, by the way, is WHY your publisher wants it as typed
text: their system can't get hold of the number either
I'll get there, but it will take another day or so
Cheers
On 1/10/05 9:37 AM, in article
(e-mail address removed), "vgolf"
Thanks for the effort you put into it John.
It does not seem to run right at the first time. However your reply was
very helpful, as I now get the idea of how it could be done, and that
no relevant feature of Word exists that I don't know of. I will try to
make it work.
Thank you again!
John McGhie [MVP - Word and Word Macintosh] wrote:
Hi Vassilis:
Hmmm... Not as easy as I thought
The short answer is "Yes. Copy the endnotes, paste as plain text atthe
bottom of the document, then delete each of the note references and replace
it with a typed number."
Not only is that a lot of work, but it's difficult because unless you work
backwards up the document, each note number will change as you delete each
endnote.
So I made a macro to do the hard work for you:
' ConvertEndNotesToText Macro
' Macro written 30 Sept 2005 by John McGhie
' Replaces Endnote references with typed numebrs and
' pastes Endnote text at end of document
Dim myDocument As Document
Dim anEndnote As Endnote
Dim myRange As Range
Dim allEndnotes As String
Dim i As Long
Set myDocument = ActiveDocument
With myDocument
.StoryRanges(wdEndnotesStory).Copy
For i = .EndNotes.Count To 1 Step -1
Set anEndnote = .EndNotes(i)
Set myRange = anEndnote.Reference
myRange.Text = Str(anEndnote.Index)
myRange.Font.Superscript = True
Next ' i
.Content.Select
With Selection
.Collapse direction:=wdCollapseEnd
.TypeParagraph
.Paste
End With
End With
End Sub
Usual caveats apply: This has not been tested extensively. I know it runs
on a Mac. I suspect it will be slow on a large document. Test it on a
COPY
of your document, because if it trashes your document: well, you accept
that
risk
If you don't know how to install a macro, see here:
http://word.mvps.org/MacWordNew/InstallMacroMac.htm
(Hit Refresh until you get the page, or use any other browser but Safari).
When the macro completes, you will see that the note reference has been
replaced with a typed superscript number. The endnotes themselves are
pasted at the end of the document.
The note reference numbers are striped from the Endnotes. Simply number
them yourself after the macro runs (they come out in the correct order as
they were listed in the Endnotes Pane).
Returning the numbers means a more complex macro I haven't got the energy
to
write tonight
Cheers
On 30/9/05 1:10 PM, in article
(e-mail address removed), "vgolf"
Hello to everyone,
I have to submit papers with endnotes, however the publishers insist
that the automatic feature is not used but the references are included
at the end of the document as part of the main text. Typing them
manually is tedious and creates problems when a reference is added and
all the following ones have to be renumbered. Is there a way to usethe
automatic Word feature during the writing process but "freezing"
everything afterwards and just include references in the text as
requested?
Thanks