GetNewWrd(visible = TRUE, template = "Normal", header = FALSE,
main = "Descriptive report")
WrdKill()
createCOMReference(ref, className)
wrd[["Documents"]]$Add(template, FALSE, 0)
, template is the templatename.
open wrd[["Documents"]]$Open(Filename="C:/MyPath/MyDocument.docx")
.
save wrd$ActiveDocument()$SaveAs2(FileName="P:/MyFile.docx")
quit word wrd$quit()
kill word task WrdKill
kills a running word task (which might not be ended with quit.)
normal text Use WrdText
which offers many arguments as fontname, size, color, alignment etc.
WrdText("Lorem ipsum dolor sit amet, consetetur", fontname="Arial",
fontsize=10, col=wdConst$wdColorRed)
simple text sel$TypeText("sed diam nonumy eirmod tempor invidunt ut labore")
heading 1 WrdCaption("My Word-Story", stylename = wdConst$wdStyleHeading1)
heading 2 WrdCaption("My Word-Story", stylename = wdConst$wdStyleHeading2)
insert R output WrdText(capture.output(str(d.diamonds)))
pagebreak sel$InsertBreak(wdConst$wdPageBreak)
move cursor right sel$MoveRight(Unit=wdConst$wdCharacter, Count=2, Extend=wdConst$wdExtend)
goto end sel$EndKey(Unit=wdConst$wdStory)
pagesetup sel[["PageSetup"]][["Bottommargin"]] <- 4 * 72
add bookmark wrd[["ActiveDocument"]][["Bookmarks"]]$Add("myBookmark")
goto bookmark sel$GoTo(wdConst$wdGoToBookmark, 0, 0, "myBookmark")
show document map wrd[["ActiveWindow"]][["DocumentMap"]] <- TRUE
insert table WrdTable
()
create table WrdInsTab
() which allows to define the table's geometry
insert caption sel$InsertCaption(Label="Abbildung", TitleAutoText="InsertCaption",
Title="My Title")
tables of figures wrd$ActiveDocument()$TablesOfFigures()$Add(Range=sel$range(),
Caption="Abbildung")
}
createCOMReference is just a wrapper for RDCOMClient::createCOMReference, as the function is not visible, if RDCOMClient is only used by required namespace.GetNewXL
, GetNewPP
# Windows-specific example
wrd <- GetNewWrd()
Desc(d.pizza[,1:4], wrd=wrd)
wrd <- GetNewWrd(header=TRUE)
Desc(d.pizza[,1:4], wrd=wrd)
Run the code above in your browser using DataLab