public void RemoveTocFromDocument()
{
//ExStart
//ExFor:CompositeNode.GetChildNodes(NodeType, Boolean)
//ExId:RemoveTableOfContents
//ExSummary:Demonstrates how to remove a specified TOC from a document.
// Open a document which contains a TOC.
Document doc = new Document(MyDir + "Document.TableOfContents.doc");
// Remove the first TOC from the document.
Field tocField = doc.Range.Fields[0];
tocField.Remove();
// Save the output.
doc.Save(MyDir + @"\Artifacts\Document.TableOfContentsRemoveTOC.doc");
//ExEnd
}