officer (version 0.3.4)

read_docx: open a connection to a 'Word' file

Description

read and import a docx file as an R object representing the document.

Usage

read_docx(path = NULL)

# S3 method for rdocx print(x, target = NULL, ...)

# S3 method for rdocx length(x)

Arguments

path

path to the docx file to use as base document.

x

an rdocx object

target

path to the docx file to write

...

unused

Examples

Run this code
# NOT RUN {
# create an rdocx object with default template ---
read_docx()

print(read_docx())
# write a rdocx object in a docx file ----
if( require(magrittr) ){
  read_docx() %>% print(target = tempfile(fileext = ".docx"))
}

# how many elements are there in the document ----
length( read_docx() )

# }

Run the code above in your browser using DataCamp Workspace