View Single Post
 
Old 01-11-2016, 04:36 PM
photoval photoval is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jan 2016
Posts: 2
photoval is on a distinguished road
Default MACRO in infinite loop when it encounters user defined figure label

I created a MACRO in VBA that looks for words in all capitals and their definitions if the user defined them and places all these words in a new document. It works for the most part but I now have a problem that if I use a heading style to create a new figure label to allow for chapter numbering in appendices then the macro gets into an infinite loop. It does a good job up to the first figure in the appendix and then decides to start back at the beginning of the document. If I select the Figure label and toggle the field codes, then the macro will work fine.

Attached is my test file. It should have the macro included. It is called "ListAcronyms"

Is there a way to get it to either skip over the specialized field codes or to toggle all the specialized field codes to be displayed at the beginning of the macro and then hide them at the end?

Thanks in Advance.

Notes on special formatting:
Heading 1-6 - typical chapter numbering 1.1.1 ....
Heading 7 - Appendix A, B, ....
Heading 8 A.1, B.1, ......
Caption - Figure label should use Heading 1 as the chapter number so you get Figure 1.1, Figure 2.4, etc. Same for Table label.
I created two new labels: Figure_Apx and Table_Apx that use Heading 7 as the chapter number so I get Figure_Apx A.1, Table_Apx A.4, etc. However I then deleted the "_Apx" and then highlighted the text to create an Autotext entry. That way when I insert AutoText FigureAppendix it will insert Figure A.1 without the extraneous "_Apx" text.

I followed http://www.shaunakelly.com/word/numb...ppendixes.html
when creating these styles.
Attached Files
File Type: docx test.docx (33.8 KB, 10 views)
Reply With Quote