Convert Endnotes to plain text...

Aug 26, 2011 at 5:19 PM

Is there a way to convert endnotes that are inline superscripts to plain, superscript numbers?

I am wrting a macro to convert a Word (2007) document that has endnotes into Wikimedia code.

So far, I have written code that goes through the footnotes and saves all the important fields to an array. Included in that array is the text I want to replace the inline number with.

For example, when the endnote 5 (a superscripted 5) is processed, the code will lookup line 5 in the array and change the superscripted number to the data is finds in the array....

Hello, world.<sup>5</sup>

becomes..

Hello, world.{{sfn|Smith|2005|p=15}}

Because {{sfn|Smith|2005|p=15}} is what i8s found in the array on line five.

The problem I'm having is that the superscripted numbers are not truly text. My "find superscript" process finds it, but .text of the selction does not equal 1,2,3,4, etc.

Plus, when I change the first endnote, then it renumbers all the rest which ruins my life.

SO... If I could make the entire document "flat" that is to say all the endnote numbers to true, superscripted numbers, I would be cured.

I hope this is not impossible. I love writing for Wikipedia, but trying to write in Word for wikipedia is a nightmare as Word interprets all the wikicode as misspellings, etc.

Thanks a lot

 

Coordinator
Aug 28, 2011 at 9:02 PM

Instead of looking for superscripted characters, you could look for "^e" which is the 'official' search symbol for endnotes. Replace those and you should be fine.