![]() |
|
#1
|
|||
|
|||
|
Hi there,
Having a small issue, I want to delete all TOCs found in ActiveDocument but whatever I do, the TOC container remains. This will delete the heading of the TOC, if any... and delete all content in range (mostly TOC fields) Code:
For Each toc In ActiveDocument.TablesOfContents
toc.Range.Previous(Unit:=wdParagraph).Delete
toc.Range.Delete
Next toc
Code:
For Each cc In ActiveDocument.ContentControls
MsgBox cc.Type
Next cc
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word Table of Contents - when I title a heading "table", table of contents shows "table2"
|
jncuk | Word | 8 | 04-15-2020 07:01 PM |
Manipulating Headings so Image contents is correctly referenced in Table of Contents
|
dynamictiger | Word | 2 | 05-29-2019 05:41 AM |
Table of Contents -"Permanently" Setting Table of Contents Option
|
KRoger | Word | 3 | 03-01-2019 06:36 AM |
Code to find a named (bookmarked?) table, replicate a row or table, and delete a specified table.
|
kevinbradley57 | Word VBA | 9 | 09-21-2017 04:58 PM |
| Text inside text boxes create headings inside my table of contents!!! How do I delete the created he | carstj | Word | 3 | 04-11-2016 12:46 PM |