Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-05-2019, 11:07 AM
d4okeefe d4okeefe is offline Broken TOC Windows 10 Broken TOC Office 2016
Advanced Beginner
Broken TOC
 
Join Date: Apr 2013
Posts: 77
d4okeefe is on a distinguished road
Default Broken TOC

First off, I'm using Word 2016 for Desktop.



I have a document that contains a TOC. The TOC has been copied from a different document and is broken. When I click "Update Table", I get a message box that says "There's no table of contents to update. You can insert one from the References tab."

However, I can see text of the original TOC. The TOC appears as formatted text, but it sits inside of a TOC Content Control. I can easily copy and paste that text using a cursor within Word.

However, I want to get at that text using VBA. Can I use VBA to find the text, copy it from the broken TOC Control, and paste it into a paragraph without the Control?

I have used the VBA Locals window to examine the document, but I can't figure it out. The "Count" property under TableOfContents is 0, as is the one for ContentControls.

I looked at the XML and see that the section is introduced like this:

HTML Code:
        <w:sdt>
            <w:sdtPr>
                <w:rPr>
                    <w:rFonts w:ascii="Century Schoolbook" w:eastAsia="Times New Roman" w:hAnsi="Century Schoolbook" w:cs="Times New Roman"/>
                    <w:szCs w:val="24"/>
                </w:rPr>
                <w:id w:val="-1392880186"/>
                <w:docPartObj>
                    <w:docPartGallery w:val="Table of Contents"/>
                    <w:docPartUnique/>
                </w:docPartObj>
            </w:sdtPr>
            <w:sdtEndPr>
                <w:rPr>
                    <w:b/>
                    <w:bCs/>
                    <w:noProof/>
                </w:rPr>
            </w:sdtEndPr>
            <w:sdtContent>
...
Any one have an idea?
Thanks in advance.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Header 3 is broken musicmouse Word 1 05-21-2019 05:41 PM
Forms Export as TXT Broken? mcknigs Word 5 10-15-2018 12:14 PM
Search is broken martinlest Outlook 0 10-14-2018 01:18 PM
Broken TOC Need to create a template that can't be broken! MSOfficeNOOB Word 1 01-17-2018 03:43 PM
Broken TOC Mutlilevel list is... broken RavingMad Word 7 04-18-2017 09:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:15 PM.


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