Aspose.Words.Examples.CSharp.Programming_Documents.Working_With_Document.RemoveTOCFromDocument.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_WorkingWithStyles();

            // Open a document which contains a TOC.
            Document doc = new Document(dataDir + "Document.TableOfContents.doc");

            // Remove the first table of contents from the document.
            RemoveTableOfContents(doc, 0);

            dataDir = dataDir + "Document.TableOfContentsRemoveToc_out.doc";
            // Save the output.
            doc.Save(dataDir);
            
            Console.WriteLine("\nSpecified TOC from a document removed successfully.\nFile saved at " + dataDir);
        }
        /// <summary>
RemoveTOCFromDocument