R
Roderick O'Regan
Word 2007 in Vista Business.
I've got a template (.dotm) with two TOCs. The first one is three
levels deep (Headings 1 to 3) and the second one showing two levels
deep and used for Appendices (Using Headings 7 & 8). These TOCs are
created programmatically.
I've created a button on a custom tab to update fields and TOCs.
The line of code to update the TOCs says:
with ActiveDocument
..TablesOfContents(1).Update
..TablesOfContents(2).Update
End With
When I run the procedure to update the TOCs I get an error which says
something to the effect:
"Method Update of Object TableOfContents failed".
Nothing gets updated!
Now here is the strange bit: using this coding in a Word 2003 template
works perfectly. Bring it over to W2007 and it doesn't work.
Is there something new about TOCs in W2007 and VBA coding that I've
missed? Could someone advise, please?
Roderick
I've got a template (.dotm) with two TOCs. The first one is three
levels deep (Headings 1 to 3) and the second one showing two levels
deep and used for Appendices (Using Headings 7 & 8). These TOCs are
created programmatically.
I've created a button on a custom tab to update fields and TOCs.
The line of code to update the TOCs says:
with ActiveDocument
..TablesOfContents(1).Update
..TablesOfContents(2).Update
End With
When I run the procedure to update the TOCs I get an error which says
something to the effect:
"Method Update of Object TableOfContents failed".
Nothing gets updated!
Now here is the strange bit: using this coding in a Word 2003 template
works perfectly. Bring it over to W2007 and it doesn't work.
Is there something new about TOCs in W2007 and VBA coding that I've
missed? Could someone advise, please?
Roderick