Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Footnotes/Endnotes in converting to html?

0 views
Skip to first unread message

Evan Goldfine

unread,
May 28, 2000, 3:00:00 AM5/28/00
to
I'd like to convert a thesis I wrote this year to html format.
There are 250 footnotes in the document.

When I save the file in html format, the footnotes disappear.
I tried converting the footnotes to endnotes, and still no
luck.

Any suggestions?

Thanks!
Evan Goldfine

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!


Doug Robbins

unread,
May 29, 2000, 3:00:00 AM5/29/00
to
Hi Evan,

The following macro will convert endnotes to "textnotes":

' 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

If you replace Endnote and Endnotes with Footnote and Footnotes, it will do
the same thing for footnotes.

Hope this helps,
Doug Robbins - Word MVP
Please post any follow-up to the Newsgroups so that others may benefit
therefrom or contribute thereto.
Evan Goldfine <ebgoldN...@yahoo.com.invalid> wrote in message
news:3d16fafc...@usw-ex0103-019.remarq.com...

Evan Goldfine

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
Doug,

Thanks for the program. I've entered the macro into my document,
but run into problems executing it.

Visual Basic says that there is an "Invalid outside procedure" in
the second line of code. (For Each aendnote In
ActiveDocument.Endnotes)

I am not experienced with macros. Perhaps I am doing something
wrong. Your help is greatly appreciated.

Thanks again,

Dave Rado

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
Doug's code works when I try it.

Did you *paste* Doug's code (so no chance of a typo?)

Is that line all on one line?

(Also ActiveDocument.Range.InsertAfter vbCr & aendnote.Index & vbTab &
aendnote.Range should alll be on one line).

Regards

Dave

Evan Goldfine <ebgoldN...@yahoo.com.invalid> wrote in message

news:25413909...@usw-ex0105-035.remarq.com...

Evan Goldfine

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
Dave,

I pasted it into visual basic, and it was all on one line (as was
the other line of code you referenced). I still get that invalid
procedure error message.

Any ideas?

Thanks!
Evan

Grant Cartledge

unread,
May 31, 2000, 3:00:00 AM5/31/00
to
Excuse me if I am teaching the sucking of eggs but did you paste the code
between a Sub...End Sub pair? [That error message is what you get if you try to
compile code under that circumstance.]

If not type "Sub HTMLProc()" (without the quotes) and press ENTER. This should
automatically generate and "End Sub". Now paste the code between the Sub...End
Sub pair and see if it works.

regards
Grant Cartledge

Doug Robbins

unread,
May 31, 2000, 3:00:00 AM5/31/00
to
Hi Evan,

I suspect that with the information provided by Grant and Dave, you probably
have this figured out by now,

However just to be sure, as Grant pointed out, the code needs to be pasted
between and Sub - End Sub in the VBE. The easiest way to get that set up
correctly is to select Macro from the Tools menu, then Macros and in the
Macros dialog, enter the name that you want to give to the macro in the
Macro name box and then click on Create. The VBE will then open with

Sub yournacroname()

' some comments about created by


End Sub.

The code that I sent to you should be pasted before the End Sub. To
overcome the problems that can occur with the email program inserting line
breaks in the code that can cause an error message, I have placed an
apostrophe and a line number at the beginning of each line of code:

'1 Dim aendnote As Endnote
'2 For Each aendnote In ActiveDocument.Endnotes
'3 ActiveDocument.Range.InsertAfter vbCr & aendnote.Index & vbTab &
aendnote.Range
'4 aendnote.Reference.InsertBefore "a" & aendnote.Index & "a"
'5 Next aendnote
'6 For Each aendnote In ActiveDocument.Endnotes
'7 aendnote.Reference.Delete
'8 Next aendnote
'9 Selection.Find.ClearFormatting
'10 Selection.Find.Replacement.ClearFormatting
'11 With Selection.Find.Replacement.Font
'12 .Superscript = True
'13 End With
'14 With Selection.Find
'15 .Text = "(a)([0-9]{1,})(a)"
'16 .Replacement.Text = "\2"
'17 .Forward = True
'18 .Wrap = wdFindContinue
'19 .Format = True
'20 .MatchWildcards = True
'21 End With
'22 Selection.Find.Execute Replace:=wdReplaceAll

If when you paste this into the VBE, there are any un-numbered lines, place
the cursor at the beginning of that line and backspace to remove the line
break. You may then need to insert a space if it is obvious that there
should be one (the line breaks will have occured at spaces between words in
the commands. Finally, remove the apostrophe and the number from the
beginning of each line.

Hope this helps,
Doug Robbins - Word MVP
Please post any follow-up to the Newsgroups so that others may benefit
therefrom or contribute thereto.

Evan Goldfine <ebgoldN...@yahoo.com.invalid> wrote in message
news:25413909...@usw-ex0105-035.remarq.com...
> Doug,
>
> Thanks for the program. I've entered the macro into my document,
> but run into problems executing it.
>
> Visual Basic says that there is an "Invalid outside procedure" in
> the second line of code. (For Each aendnote In
> ActiveDocument.Endnotes)
>
> I am not experienced with macros. Perhaps I am doing something
> wrong. Your help is greatly appreciated.
>
> Thanks again,
> Evan Goldfine
>

0 new messages