Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-17-2025, 07:33 AM
TheBigBoss TheBigBoss is offline Delete a table of contents Windows 10 Delete a table of contents Office 2016
Advanced Beginner
Delete a table of contents
 
Join Date: Dec 2016
Posts: 58
TheBigBoss is on a distinguished road
Default Delete a table of contents

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
What is the property of the TOC container, it is not a Content Control as this returns nothing
Code:
For Each cc In ActiveDocument.ContentControls
        MsgBox cc.Type
Next cc
Thanks for your help
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete a table of contents Word Table of Contents - when I title a heading "table", table of contents shows "table2" jncuk Word 8 04-15-2020 07:01 PM
Delete a table of contents Manipulating Headings so Image contents is correctly referenced in Table of Contents dynamictiger Word 2 05-29-2019 05:41 AM
Delete a table of contents Table of Contents -"Permanently" Setting Table of Contents Option KRoger Word 3 03-01-2019 06:36 AM
Delete a table of contents 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

Other Forums: Access Forums

All times are GMT -7. The time now is 06:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft