docx_summary: Get Word content in a data.frame

View source: R/fortify_docx.R

docx_summaryR Documentation

Get Word content in a data.frame

Description

read content of a Word document and return a data.frame representing the document.

Usage

docx_summary(x, preserve = FALSE)

Arguments

x

an rdocx object

preserve

If FALSE (default), text in table cells is collapsed into a single line. If TRUE, line breaks in table cells are preserved as a "\n" character. This feature is adapted from docxtractr::docx_extract_tbl() published under a MIT licensed in the {docxtractr} package by Bob Rudis.

Note

Documents included with body_add_docx() will not be accessible in the results.

Examples

example_pptx <- system.file(package = "officer",
  "doc_examples/example.docx")
doc <- read_docx(example_pptx)

docx_summary(doc)

docx_summary(doc, preserve = TRUE)[28, ]

officer documentation built on Oct. 22, 2023, 5:06 p.m.