ReporteRs (version 0.7.6)

text_extract: Simple Text Extraction From a Word Document

Description

Provides a simple method to get text from a docx document. It returns a character vector containing all chunk of text found in the document.

Usage

text_extract(x, body = TRUE, header = TRUE, footer = TRUE, bookmark)

Arguments

x

docx object

body

specifies to scan document body

header

specifies to scan document header

footer

specifies to scan document footer

bookmark

a character value ; id of the Word bookmark to scan.

Value

a character vector

See Also

docx, list_bookmarks

Examples

Run this code
# NOT RUN {
#START_TAG_TEST
doc = docx( title = "My example", template = file.path( 
  find.package("ReporteRs"), "templates/bookmark_example.docx") )
text_extract( doc )
text_extract( doc, header = FALSE, footer = FALSE )
text_extract( doc, bookmark = "author" )
#STOP_TAG_TEST
# }

Run the code above in your browser using DataCamp Workspace