I'm writing a macro to do some word->HTML conversion. For part of this
I need to be able to loop through the footnotes, grab the referenc
numbers and insert them elsewhere in the text of the document.
I've tried two things: selecting the reference from the Footnot
object and then cutting-and-pasting into the body:
ActiveDocument.Footnotes(1).Reference.Select
Selection.Copy
. . .
Selection.Paste
This creates another footnote. Not what I want.
I've also tried just grabbing the text of the reference:
myRefNum$ = ActiveDocument.Footnotes(1).Reference.Text
But, for some reason, this always gives me garbage (it comes out as
box...)
Any ideas?
The other thing I should mention is that there are different styles o
footnotes in the documents and at least one numbering restart, so
can't just go by the Footnote.Index.
Thx
--
cfulme
See this thread for a macro that converts endnotes to text, which I think
follows the model you describe, and may help you:
[link may break, you may need to reconstitute]
http://groups.google.com/group/microsoft.public.word.docmanagement/browse_fr
m/thread/a60669f0936214e0/205fdab76e4e48eb
If further help is necessary, requests for aid writing code for macros are
better directed to a group that specializes in Word VBA, aka Word
Programming, for instance:
[you may need to re-wrap these URLs if they are not clickable]
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.pu
blic.word.vba.general&lang=en&cr=US
If just beginning with macros, this group is for beginners:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=micros
oft.public.word.vba.beginners&lang=en&cr=US
There are many more people in those groups who have the ability to answer
your question, so you will probably get a better and faster answer there.
> I'm writing a macro to do some word->HTML conversion. For part of this,
> I need to be able to loop through the footnotes, grab the reference
[quoted text clipped - 5 lines]
> ActiveDocument.Footnotes(1).Reference.Select
> Selection.Copy

Signature
Daiya Mitchell, MVP Mac/Word
Word FAQ: http://www.word.mvps.org/
MacWord Tips: <http://www.word.mvps.org/MacWordNew/>
What's an MVP? A volunteer! Read the FAQ: http://mvp.support.microsoft.com/