Learn R Programming

R2wd (version 1.4)

wdGet: Gets a handle to Word.

Description

wdGet checks first if Word is already running. If this is not the case, it will start Word, add a document and then return the handle to the Word application. If Word is already running and has an active document, it will just return the handle.

Usage

wdGet(filename = NULL, path = "", doc = NULL, visible = TRUE)

Arguments

filename
the filename of an existing word document (if null, make a new one)
path
the path to an existing word document
doc
(not yet used)
visible
whether the Word application should be visible.

Value

  • a handle to the COM object refering to the Word application.

Examples

Run this code
wdGet()
wdTitle("R2wd, a package to write Word documents from R")

Run the code above in your browser using DataLab