Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
TOC in Word 2007
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 |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
TOC in Word 2007
Does your macro take into account the fact that pressing F9 in a TOC will
ordinary pop up a dialog requiring a choice between the entire table and just the page numbers? That would be true in any version, however. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "Roderick O'Regan" wrote in message ... 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 |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
TOC in Word 2007
Thanks for the reply Suzanne.
Actually, pressing F9 within a TOC in my .dotm template does nothing at all. The thing that is really disturbing is that the exact coding and structure in W2003 works perfectly. Put it into W2007 and errors mentioned previously appear. The only way I can get all my TOCs and TOFs to update is to go to (in W2007) ReferencesUpdate Table. Using the macro recorder to see what it is actually doing, it uses, of all things the coding 'Wordbasic.UpdateTableOfContents' of all things! Roderick On Thu, 28 Aug 2008 12:36:22 -0500, "Suzanne S. Barnhill" wrote: Does your macro take into account the fact that pressing F9 in a TOC will ordinary pop up a dialog requiring a choice between the entire table and just the page numbers? That would be true in any version, however. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
TOC in Word 2007
Oh, ouch! Another example of how impossible it is to completely eradicate
Word Basic from VBA! -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "Roderick O'Regan" wrote in message ... Thanks for the reply Suzanne. Actually, pressing F9 within a TOC in my .dotm template does nothing at all. The thing that is really disturbing is that the exact coding and structure in W2003 works perfectly. Put it into W2007 and errors mentioned previously appear. The only way I can get all my TOCs and TOFs to update is to go to (in W2007) ReferencesUpdate Table. Using the macro recorder to see what it is actually doing, it uses, of all things the coding 'Wordbasic.UpdateTableOfContents' of all things! Roderick On Thu, 28 Aug 2008 12:36:22 -0500, "Suzanne S. Barnhill" wrote: Does your macro take into account the fact that pressing F9 in a TOC will ordinary pop up a dialog requiring a choice between the entire table and just the page numbers? That would be true in any version, however. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding Powerpoint 2007 slide as landscape into Word 2007 portrait | Page Layout | |||
insert Access 2007 database table into a Word 2007 doc and print | Microsoft Word Help | |||
Unable to download templates using Word 2007 (MS Office 2007 Stand | Microsoft Word Help | |||
multi-page visio 2007 in word 2007 with automatic figure caption | Microsoft Word Help | |||
Change layout of address inserted from Outlook 2007 to Word 2007? | Microsoft Word Help |