Word Macro to Convert Non-Functional Endnotes/Footnotes

Page 1 of 2 (28 items) 1 2 Next >
This post has 27 Replies | 3 Followers

Posts 1703
Robert M. Warren | Forum Activity | Posted: Fri, Aug 8 2014 9:03 PM

I have been using a down-and-dirty set of macros to convert "dead" endnotes and footnotes to "live" MS Word footnotes, which are functional in Logos when compiled as a Personal Book. I have attempted to dress it up a bit with an interface in order to share it. I might have missed it, but I don't believe anything similar has been posted.

This tool is Dropbox-linked here and I hope it is found useful by Forum friends. (*smile*)

A real programmer would most certainly be able to improve upon it, and is urged to do so and share it. Also, if anyone would like to include this in a larger set of tools, please do so.

The document contains the macro and the documentation, which should be read carefully and all cautions followed.

https://www.dropbox.com/s/gvhxteqylvrxnol/Footnote%20Converter%20V2.docm 

Win 10 Android 8.1 Fire OS 5

Posts 980
JohnB | Forum Activity | Replied: Sat, Aug 9 2014 6:10 AM

Great!!

I had wondered about doing it myself but lacked the stamina to do something to cope with the various alternatives that one can find.

Also it would have remained as a set of down-and-dirty macros with no interface.

Thanks so much Robert.

Posts 1507
Forum MVP
Fr Devin Roza | Forum Activity | Replied: Tue, Sep 2 2014 3:53 AM

Thanks Robert!

Posts 1703
Robert M. Warren | Forum Activity | Replied: Sun, Dec 14 2014 2:16 PM

Updated Version.

Good Afternoon:

After using it for a few months, I have revised the converter so that font color and size can be unspecified.

The Dropbox link is here:  https://www.dropbox.com/s/oosgb86xrjcfb0f/Footnote%20Converter%20V3.docm?dl=0 

The earlier version linked above has been removed.

Win 10 Android 8.1 Fire OS 5

Posts 414
George | Forum Activity | Replied: Mon, Dec 15 2014 7:31 AM

Thank you, Robert!  Your generosity is much appreciated.

Posts 45
M G Smith | Forum Activity | Replied: Wed, Jan 21 2015 6:25 AM

Robert, thank you for all your work with this.

Now that I have found a workaround to some problems (see below) I am able to make footnotes "live" where before I could not have justified the time that would have been needed. That said, my initial attempts to use the earlier version, and this version of the macro put me off. So I hope my findings will encourage others to persevere and so gain the benefit I have from your work.

I should say that my 'workflow' involves splitting the book file into different docx files for each chapter, so I ignore some of the earlier instructions in your file, however it is still necessary to check that footnotes are not split over more than one paragraph, for example.

Problem and Workaround 1

In the first file I had success with both the footnote numbers in the text, and at the beginning of the endnotes, were superscript. The fact that the macro was searching for the same thing in both locations proved important. I had previously left the default setting of 'delete' in the Old Footnotes section of the dialogue and this resulted in the macro falling over if it was unable to find any footnote number in the text (I have been unable to work out why some numbers give problems.) The workaround I stumbled on was simply to change the Old Footnotes section to 'keep'. Doing this allowed the macro to run successfully to completion, however, any footnote numbers missed in the text are now 'found' in the endnotes and for these missed numbers the footnote is created in the endnotes! Scrolling through the endnotes easily shows which, if any, numbers have been changed from plain numbers to footnote markers. It is no great work to note which numbers are affected and to manually create footnootes at the appropriate place. (I use a duplicate copy of the original docx file to aid in this process.) To give some idea of my findings, the stats for my heavily footnoted file were as follows: (number of footnotes, number of missed numbers) (90, 7); (71, 5); (123, 12); (194, 17); (101, 5); (98, 1); (79, 4); (4, 0). As a final step, the original endnote text is deleted manually.

Problem and Workaround 2

Encouraged by my success I moved on to another book where the footnote numbers in the text were superscript but not so in the endnotes. Here my initial results looked equally encouraging: the macro ran through to completion. However, checking quickly revealed that text had often been identified as footnote text in error. Indeed such was the confusion that resulted I consider it would be impossible to try to sort what resulted. The workaround in this case is to do a search and replace of the numbers marking each endnote and changing them to superscript. (I can detail the steps involved if it would be helpful). This may involve some work (and workaround 1 has then to be followed) but in contrast to the steps involved in manually creating footnotes I consider it to be well worthwhile.

Thanks again for sharing this macro with us.

Posts 1394
James Taylor | Forum Activity | Replied: Wed, Jan 21 2015 4:58 PM

Anyone know if any macro's can work with Libreoffice, I don't have Word but I make a ton of PBs and I'm sure macros would save me so much time that it's probably worth me just splurging on Word/Office but either way, any thoughts? suggestions?

Thanks, 

james

Logos 8  | Dell Inspiron 7373 | Windows 10 Pro 64, i7, 16GB, SSD | iPhone X | iMac 27" i7, 16GB, SSD | OS 10.13

Posts 1703
Robert M. Warren | Forum Activity | Replied: Wed, Jan 21 2015 5:28 PM

MG: I am glad you found it useful.

Like you, i have encountered some very stubborn documents with inconsistencies and/or difficult-to-determine font attributes. Sometimes I just acknowledge when I'm licked and I punt and live with the dead footnotes.

The good part for me is I mainly convert Kindle books, which tend to be consistent. (But even then, there's some rascals.) I originally had ambitions to make better use of the PDFs at CCEL.org, which tend to have rich footnoting. But when I got Word 2013, most PDF footnote issues were solved, since it usually converts them live.

Win 10 Android 8.1 Fire OS 5

Posts 1703
Robert M. Warren | Forum Activity | Replied: Wed, Jan 21 2015 5:41 PM

James Taylor:
Anyone know if any macro's can work with Libreoffice, I don't have Word but I make a ton of PBs and I'm sure macros would save me so much time that it's probably worth me just splurging on Word/Office but either way, any thoughts?

James:

I'm not sure about programs other than MS Word. There are a few forum users who have a more varied knowledge about programming, etc., than I do. Perhaps one of them will chime in. I think most office suites run some kind of scripting or programming like Visual Basic, but I doubt they share the exact object model to run this particular set of macros.

Something to consider: If your employer pays for one of a certain number of enterprise licences with MS, you might be eligible for their Home Use Program, whereby one pays a very low price ($10 US for me). and gets Office Professional. As long as you work for that employer and they continue in the license, it's perfectly legit. (It actually helps MS in the long run, developing knowledgeable and loyal users.)

Win 10 Android 8.1 Fire OS 5

Posts 353
Virgil Buttram | Forum Activity | Replied: Sun, Feb 22 2015 12:32 PM

I may be missing something obvious...

My endnotes are formatted as numbered lists. How to I configure the macro to identify them as followed by a period and a tab?

Posts 1703
Robert M. Warren | Forum Activity | Replied: Mon, Feb 23 2015 7:16 PM

Virgil Buttram:
How to I configure the macro to identify them as followed by a period and a tab?

Hi Virgil:

Do this:  In the two "Characters following" boxes, enter "." then "^t" (no quotes). The ^t is Word's code for a tab character (which is non-displaying). To see non-displaying marks, click the button with the paragraph symbol ¶ on the Home tab.

Codes I use frequently:

Tab                             ^t
Paragraph mark         ^13     (could use ^p, but only if not using wildcards)
Non-breaking space    ^s      (this looks like a degree symbol when show ¶ is pressed)
Manual line-break        ^l      (looks like the symbol on the Enter key on the keyboard when ¶ is pressed)

Other codes can be seen by clicking Replace on the Home tab (at the right-end) and clicking the More>> button, then the Special button. You can probably find a long list of codes on the Web.

Hope that helps.

Win 10 Android 8.1 Fire OS 5

Posts 353
Virgil Buttram | Forum Activity | Replied: Tue, Feb 24 2015 3:34 PM

Robert,

I tried entering the '^t" and it didn't work. It appears that the macro does not read the numbering of a numbered list as the index number of the endnote. So far, I'm doing the conversion manually. Time consuming, but it works.

Posts 1703
Robert M. Warren | Forum Activity | Replied: Tue, Feb 24 2015 5:40 PM

Ah, yes, I understand now. I didn't realize it was a Word-controlled list; I just assume it was number-period-tab. The next time I revise the documentation, I'll add that the macro can only do things that Word's Find & Replace can do manually. I've tried it myself to no avail. Apparently Word stores these numbers somehow, but they're not visible for normal commands. They're probably some kind of Field, and since they're dynamic, they can't be manipulated like other elements.

If anyone knows how to make Find & Replace recognize these kinds of numbers, let me know and I'll revise the macro.

Win 10 Android 8.1 Fire OS 5

Posts 1703
Robert M. Warren | Forum Activity | Replied: Wed, Feb 25 2015 5:19 PM

OK, Virgil:  I found a quickie way to convert (all of the) numbered-lists in a document:

"...there is a quick way. Simply follow these steps:

Open the document whose numbering you want to convert. (You may want to open a copy of the document so that you don't mess up the original document.)
Press Alt+F11. Word displays the VBA Editor.
Press Ctrl+G. This opens the Immediate window.
Type the following in the Immediate window:
ActiveDocument.Range.ListFormat.ConvertNumbersToText
Press Enter."

This came from this webpage:  http://wordribbon.tips.net/T010248_Converting_Automatic_Numbering_to_Manual_Numbering.html 

You could also make that into a simple macro by entering this into a module in VBE:

Sub ConvNumbList()

ActiveDocument.Range.ListFormat.ConvertNumbersToText

End Sub

To view the VBE, you might have to expose the Developer tab, which MS hides by default, as part of their contest to out-nanny Apple. (File-->Options-->Customize the Ribbon-->check the Developer tab on the right side of the dialog.) Once you can see the Developer tab, you can also use the Macros button to execute the macro.

Downside: this converts every numbered-list in the document. I experimented with changing "ActiveDocument" above to "Selection", but I was not able to select the numbers in the numbered-list.

Win 10 Android 8.1 Fire OS 5

Posts 353
Virgil Buttram | Forum Activity | Replied: Wed, Feb 25 2015 6:22 PM

I've already finished the document I was working on, but I will remember this trick for any future documents.

Thanks!

Posts 1703
Robert M. Warren | Forum Activity | Replied: Thu, Feb 26 2015 2:21 PM

Thank you , too. This part of the thread might help someone down the road.

Win 10 Android 8.1 Fire OS 5

Posts 353
Virgil Buttram | Forum Activity | Replied: Thu, Feb 26 2015 4:56 PM

Robert M. Warren:

Thank you , too. This part of the thread might help someone down the road.

Agreed!

Posts 1703
Robert M. Warren | Forum Activity | Replied: Sat, Jul 30 2016 1:04 PM

Good Afternoon:

I upgraded to Word 2016 and the first time I tried this macro, I received a run-time error. During a search of some help forums, I stumbled upon a solution.

Here is a Dropbox link to Version 4:   https://www.dropbox.com/s/l94rrxcjli1c4cm/Footnote%20Converter%20V4.docm?dl=0 

Win 10 Android 8.1 Fire OS 5

Posts 1
Fr. Kevin Zilverberg | Forum Activity | Replied: Tue, Nov 1 2016 11:18 AM

Thanks, Robert! You've done a real service here; I have long wished that I could convert dead footnotes in DOCX files created from websites. It is a marvel to watch the macro insert the footnotes.

The document on which I used the macro, Das jüdische Volk und seine heilige Schrift in der christlichen Bibel (http://www.vatican.va/roman_curia/congregations/cfaith/pcb_documents/rc_con_cfaith_doc_20020212_popolo-ebraico_ge.html), contains 355 footnotes. I changed the font size of the superscript in-text note markers to 11 and the "dead" notes to 11.5 to help the macro distinguish these correctly. For some reason the macro failed to insert five footnotes, so I ended up with 350, all of which were correctly identified. The new superscript markers were not font size 11, so it was easy to then search the document for the five size-11 unconverted note markers and manually insert live footnotes. I look forward to reading the document on my Kindle.

Posts 1703
Robert M. Warren | Forum Activity | Replied: Tue, Nov 1 2016 3:02 PM

You're welcome, sir. I hope it's helpful.

Win 10 Android 8.1 Fire OS 5

Page 1 of 2 (28 items) 1 2 Next > | RSS