Hi all,
First posting here, so I hope you can help me out.
I consider myself an advanced Excel and Word user and I dabble in VBA to fix various things.
I’m using Microsoft Office 365 and in particular for this question Word 16.0.7070.2833 (but it seems to be the same problem in all Word versions!)
I have a rather large document template that comprises around 50 different ‘chapters’, each requiring a unique prefix to the paragraph numbering that is independent of the other chapters. Users delete and amend the chapters to suit their particular needs, and make a final document with a single TOC. Unfortunately the document is confidential so I can’t share it.
We have previously had significant issues with formatting when documents created using previous templates used any in-built Word styles, so each chapter has a unique set of level 1 to 9 numbering styles, all based on a “nostyles” base. Unintended consequence - This means they are not linked to Heading 1, Heading 2 etc so the standard 2 level TOC feature doesn’t work.
What I need is a Table of Contents that includes all the ‘custom’ level 1 and 2 styles – seems easy huh!
Unfortunately, there seems to be a limit to the number of entries in a TOC field, and the TOC basically truncates at various points.
What I’m seeking I suspect is not achievable other than using VBA (which is what led me here!) BUT if anyone has suggestions on fixing it without VBA I’m all ears!
As an example, I’ve tried the TOC field as follows:
{TOC \h \z \t "ABC_Test(H): C1 2,2,ABC_Test(H): C2 1,1,ABC_Test(H): C2 2,2,ABC_Test(H): M01 1,1,ABC_Test(H): M01 2,2,ABC_Test(H): M02 1,1,ABC_Test(H): M02 2,2,ABC_Test(H): M03 1,1,ABC_Test(H): M03 2,2,ABC_Test(H): M04 1,1,ABC_Test(H): M04 2,2,ABC_Test(H): M05 1,1,ABC_Test(H): M05 2,2,ABC_Test(H): M06 1,1,ABC_Test(H): M06 2,2,ABC_Test(H): M07 1,1,ABC_Test(H): M07 2,2,ABC_Test(H): M08 1,1,ABC_Test(H): M08 2,2,ABC_Test(H): M09 1,1,ABC_Test(H): M09 2,2,ABC_Test(H): M10 1,1,ABC_Test(H): M10 2,2,ABC_Test(H): M11 1,1,ABC_Test(H): M11 2,2,ABC_Test(H): M12 1,1,ABC_Test(H): M12 2,2,ABC_Test(H): M13 1,1,ABC_Test(H): M13 2,2,ABC_Test(H): M14 1,1,ABC_Test(H): M14 2,2,ABC_Test(H): MO10 1,1,ABC_Test(H): MO10 2,2,ABC_Test(H): S01 1,1,ABC_Test(H): S01 2,2,ABC_Test(H): S02S 1,1,ABC_Test(H): S02S 2,2,ABC_Test(H): S03 1,1,ABC_Test(H): S03 2,2,ABC_Test(H): S04 1,1,ABC_Test(H): S04 2,2,ABC_Test(H): S05 1,1,ABC_Test(H): S05 2,2,ABC_Test(H): S06S 1,1,ABC_Test(H): S06S 2,2,ABC_Test(H): S07 1,1,ABC_Test(H): S07 2,2,ABC_Test(H): S07S 1,1,ABC_Test(H): S07S 2,2,ABC_Test(H): S08 1,1,ABC_Test(H): S08 2,2,ABC_Test(H): S09 1,1,ABC_Test(H): S09 2,2,ABC_Test(H): S10 1,1,ABC_Test(H): S10 2,2,ABC_Test(H): S11 1,1,ABC_Test(H): S11 2,2,ABC_Test(H): S12 1,1,ABC_Test(H): S12 2,2,ABC_Test(H): S13S 1,1,ABC_Test(H): S13S 2,2,ABC_Test(H): S14 1,1,ABC_Test(H): S14 2,2,ABC_Test(H): S15 1,1,ABC_Test(H): S15 2,2,ABC_Test(H): S16 1,1,ABC_Test(H): S16 2,2,ABC_Test(H): S17 1,1,ABC_Test(H): S17 2,2,ABC_Test(H): S18 1,1,ABC_Test(H): S18 2,2,ABC_Test(H): S19 1,1,ABC_Test(H): S19 2,2,ABC_Test(H): S30 1,1,ABC_Test(H): S30 2,2,ABC_Test(H): S30S 1,1,ABC_Test(H): S30S 2,2,ABC_Test(H): S31S 1,1,ABC_Test(H): S31S 2,2,ABC_Test(H): S32 1,1,ABC_Test(H): S32 2,2,ABC_Test(H): S33 1,1,ABC_Test(H): S33 2,2,ABC_Test(H): S34 1,1,ABC_Test(H): S34 2,2,ABC_Test(H): S35 1,1,ABC_Test(H): S35 2,2,ABC_Test(H): S36 1,1,ABC_Test(H): S36 2,2,ABC_Test(H): S37 1,1,ABC_Test(H): S37 2,2,ABC_Test(H): S38 1,1,ABC_Test(H): S38 2,2,ABC_Test(H): S39 1,1,ABC_Test(H): S39 2,2,ABC_Test(H): S40 1,1,ABC_Test(H): S40 2,2,ABC_Test(H): Title,1"}
With the current template content, the generated TOC stops at about the end of chapter MO4 (ie styles ABC_Test(H): M04 1,1 and ABC_Test(H): M04 2,2). From experimentation, the stopping point always seems to be near the style that is around the 240-250 character point in the TOC field.
I’ve tried bookmarking each chapter and then including the specific styles for that chapter, and that kinda works but is very tedious. I can also see problems with users who don’t understand Word messing with the Bookmarks accidentally or otherwise, as well as for maintenance of the template (which may not be done by experienced Word people).
So, all and any ideas gratefully received – I’m pulling my hair out!
Thanks in Advance:-)
Cheers
…Steve