# 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