Tagging Footnotes

V

Vince

I am not sure how to accomplish the following:

Input:
Old McDonald* had a farm1 eieio2 and on his farm3 he had some4


1 This is a big guy
2 The farm measures 100 Hectare
3 Some Rhyming tune
4 He had many farms
5 Other animals are present too

Desired Output:
Old McDonald<Reference Foot Note 1>*</Reference> had a farm<Reference Foot
Note 2>1</Reference> eieio<Reference Foot Note 3>2</Reference> and on his
farm<Reference Foot Note 4>3</Reference> he had some<Reference Foot Note
5>4</Reference>

<Foot Note 1>* This is a big guy</Foot Note 1>
<Foot Note 2>1 The farm measures 100 Hectare</Foot Note 2>
<Foot Note 3>2 Some Rhyming tune</Foot Note 3>
<Foot Note 4>3 He had many farms</Foot Note 4>
<Foot Note 5>4 Other animals are present too</Foot Note 5>

Comments:
The *,1,2,3 and 4 are in superscript in the text
The bottom 1,2,3,4,5 are footnotes

Questions:
How do I do this in one go with a "For each FNote in
activedocument.footnotes loop"? Currently, I first run through the
footnotes, store the footnote mark and the corresponding number (a counter
is used) in an array. Then, I run through the document, look for
superscripted numerals and tag them. When I try my own loop to do this in
one go, I am unable to select the footnote number along with the text for
tagging purposes. For instance, FootNoteObject.reference.text.select does
not select the foornote number but selects the reference.

Any ideas?

Thank you for reading / responding.

Vince
 
D

Doug Robbins

Should be possible to modify the following macro to do that

' Macro created 29/09/99 by Doug Robbins to replace endnotes with textnotes
at end of document

' 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

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
V

Vince

Thank you Doug. I'll modify it.


Doug Robbins said:
Should be possible to modify the following macro to do that

' Macro created 29/09/99 by Doug Robbins to replace endnotes with textnotes
at end of document

' 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

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
Vince said:
I am not sure how to accomplish the following:

Input:
Old McDonald* had a farm1 eieio2 and on his farm3 he had some4


1 This is a big guy
2 The farm measures 100 Hectare
3 Some Rhyming tune
4 He had many farms
5 Other animals are present too

Desired Output:
Old McDonald<Reference Foot Note 1>*</Reference> had a farm<Reference Foot
Note 2>1</Reference> eieio<Reference Foot Note 3>2</Reference> and on his
farm<Reference Foot Note 4>3</Reference> he had some<Reference Foot Note
5>4</Reference>

<Foot Note 1>* This is a big guy</Foot Note 1>
<Foot Note 2>1 The farm measures 100 Hectare</Foot Note 2>
<Foot Note 3>2 Some Rhyming tune</Foot Note 3>
<Foot Note 4>3 He had many farms</Foot Note 4>
<Foot Note 5>4 Other animals are present too</Foot Note 5>

Comments:
The *,1,2,3 and 4 are in superscript in the text
The bottom 1,2,3,4,5 are footnotes

Questions:
How do I do this in one go with a "For each FNote in
activedocument.footnotes loop"? Currently, I first run through the
footnotes, store the footnote mark and the corresponding number (a counter
is used) in an array. Then, I run through the document, look for
superscripted numerals and tag them. When I try my own loop to do this in
one go, I am unable to select the footnote number along with the text for
tagging purposes. For instance, FootNoteObject.reference.text.select does
not select the foornote number but selects the reference.

Any ideas?

Thank you for reading / responding.

Vince
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top