Learn R Programming

DescTools (version 0.99.17)

WrdParagraphFormat: Get or Set the Paragraph Format in Word

Description

WrdParagraphFormat can be used to get and set the font in Word for the text to be inserted. WrdParagraphFormat returns the font at the current cursor position.

Usage

WrdParagraphFormat(wrd = getOption("lastWord")) WrdParagraphFormat(wrd) <- value

Arguments

value
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).

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").

Value

a list of the attributes of the font in the current cursor position:
name
the fontname
size
the fontsize
bold
bold
italic
italic

See Also

WrdText, WrdPlot, GetNewWrd, GetCurrWrd

Examples

Run this code
## Not run:  # Windows-specific example
# # start word
# wrd <- GetNewWrd()
# 
# for( i in seq(10, 24, 2)) {
#   WrdText(gettextf("This is Arial size %s \n", i), appendCR=FALSE,
#     fontname="Arial", fontsize=i)
# }
# for( i in seq(10, 24, 2)) {
#   WrdText(gettextf("This is Times size %s \n", i), appendCR=FALSE,
#     fontname="Times", fontsize=i)
# }
# ## End(Not run)

Run the code above in your browser using DataLab