toc: Compute table of contents from Word docx file

tocR Documentation

Compute table of contents from Word docx file

Description

This function returns information about the table of contents or organization of the sections in the specified Word document.

Usage

toc(file, ...)

Arguments

file

the docx file, either a string or an object of class WordArchive

...

additional parameters for the methods.

Value

A character vector giving the "titles" of each section found. The level of each section is provided via the attribute named levels. The class of this object is an S3 class named DocumentTableOfContents.

Author(s)

Duncan Temple Lang duncan@wald.ucdavis.edu

Examples

   #  Sample Table of Contents
 #  This illustrates extracting the table of contents from a sample
 #  document that has several Heading 1, 2 and 3 styles.
f = system.file("SampleDocs", "toc.docx", package = "RWordXML")
doc = wordDoc(f)
tt = toc(doc)
tt
        

duncantl/RWordXML documentation built on Nov. 23, 2023, 4:23 p.m.