Learn R Programming

R2wd (version 1.4)

wdSetFont: Set font in Word.

Description

This function allows to set the font type and the font size of the active Word document.

Usage

wdSetFont(fontname = NULL, fontsize = NULL, bold=NULL, italic=NULL,wdapp = .R2wd)

Arguments

fontname
A font name Word knows about, such as Arial, Times New Roman, etc.
fontsize
The point size of the font.
bold
The point size of the font.
italic
The point size of the font.
wdapp
The handle to Word.

Value

    Details

    This function uses the handle .R2wd to talk to Word and to change font name and size at the current position of the cursor in the active document.

    Examples

    Run this code
    wdGet()
    wdTitle("Title")
    wdWrite("This is in normal font")
    wdSetFont(fontname="Garamond",fontsize=14,bold=TRUE,italic=TRUE)
    wdWrite("This is in 14pt Garamond")
    wdNormal("This switches back to Normal")

    Run the code above in your browser using DataLab