ToWrdB: Send Objects to Word and Bookmark Them

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/DescTools.r

Description

Send objects like tables, ftables, lm tables, TOnes or just simple texts to a MS-Word document and place a bookmark on them. This has the advantage, that objects in a Word document can be updated later, provided the bookmark name has been stored.

Usage

1
2
ToWrdB(x, font = NULL, ..., wrd = DescToolsOptions("lastWord"), 
        bookmark = gettextf("bmt%s", round(runif(1, min = 0.1) * 1e+09)))

Arguments

x

the object to be transferred to Word.

font

the font to be used to the output. This should be defined as a list containing fontname, fontsize, bold and italic flags:
list(name="Arial", size=10, bold=FALSE, italic=TRUE).

...

further arguments to be passed to or from methods.

wrd

the pointer to a word instance. Can be a new one, created by GetNewWrd() or an existing one, created by GetCurrWrd(). Default is the last created pointer stored in DescToolsOptions("lastWord").

bookmark

the name of the bookmark.

Details

This function encapsulates ToWrd, by placing a bookmark over the complete inserted results. The given name can be questioned with bm$name().

Value

a handle to the set bookmark

Author(s)

Andri Signorell <andri@signorell.net>

See Also

ToWrd, WrdInsertBookmark

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# we can't get this through the CRAN test - run it with copy/paste to console

wrd <- GetNewWrd()
bm <- ToWrdB("This is text to be possibly replaced later.")

# get the automatically created name of the bookmark
bm$name()

WrdGoto(bm$name())
UpdateBookmark(...)

## End(Not run)

DescTools documentation built on June 17, 2021, 5:12 p.m.