DescTools (version 0.99.13)

WrdCaption: Insert Caption to Word

Description

Insert a caption in a given level to a Word document. The caption is inserted at the current cursor position.

Usage

WrdCaption(x, stylename = wdConst$wdStyleHeading1, wrd = getOption("lastWord"))

Arguments

x
the text of the caption.
stylename
the name of the heading style in local language or the appropiate word constant.
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 getOption("lastWord").

See Also

WrdText, WrdPlot, GetNewWrd, GetCurrWrd

Examples

Run this code
# Windows-specific example
wrd <- GetNewWrd()
# insert a title in level 1
WrdCaption("My First Caption level 1", stylename=wdConst$wdStyleHeading1, wrd=wrd)

# works as well for several levels
sapply( 1:5, function(i) 
  WrdCaption(gettextf("My First Caption level             stylename=eval(parse(text=gettextf("wdConst$wdStyleHeading             wrd=wrd)
)

Run the code above in your browser using DataCamp Workspace