Docx: Microsoft Word document representation - class '"Docx"'

Description Objects from the Class Slots Methods Note Author(s) References Examples

Description

Objects from the class "Docx" represent Microsoft Word document. All corresponding methods are used to send R output into this object.

Objects from the Class

Objects can be created by calls of the form new("Docx", title="Title of the document", basefile).

Slots

title

Object of class "character": title of the document (in the doc properties).

basefile:

Object of class "character" which represents the filename of the docx file used as a template.

Methods

addPlot

signature(x = "Docx", ...): Add a graph.

addParagraph

signature(x = "Docx", ...): Add a paragraph.

addTable

signature(x = "Docx", ...): Add a table.

addTOC

signature(x = "Docx", ...): Add a table of contents.

styles

signature(x = "Docx", ...): get available styles.

replaceText

signature(x = "Docx", ...): replace text.

writeDoc

signature(x = "Docx", ...): write the docx object in a file.

Note

R2DOCX supports Word 2007-2013 (*.docx) file formats.
Document are manipulated in-memory ; a Docx's document is not written to the disk unless the writeDoc method has been called on the object.

Author(s)

David Gohel

References

Wikipedia: Office Open XML
http://en.wikipedia.org/wiki/Office_Open_XML

Examples

1
2
3
4
5
6
7
# Create a new document 
doc <- new("Docx", title = "title" )
# Add "Hello World" into the document
doc <- addParagraph(doc, "Hello Word!", "Normal");
# writes document into file "Hello_Word.docx"

writeDoc( doc, "Hello_Word.docx" )

davidgohel/R2DOCX documentation built on May 14, 2019, 11:13 p.m.