DescTools (version 0.99.18)

WrdFormatCells: Format Cells Of a Word Table

Description

Format cells of a Word table.

Usage

WrdFormatCells(wtab, rstart, rend, col = NULL, bg = NULL, font = NULL, border = NULL, align = NULL)

Arguments

wtab
a handle to the word table as returned i.g. by WrdTable

rstart
the left/upper cell of the cell range

rend
the right/lower cell of the cell range

col
the foreground colour

bg
the background colour

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, color=wdConst$wdColorBlack).

border
the border of the cell range, defined as a list containing arguments for border, linestyle, linewidth and color. border is a vector containing the parts of the border defined by the Word constants wdConst$wdBorder..., being $wdBorderBottom, $wdBorderLeft, $wdBorderTop, $wdBorderRight, $wdBorderHorizontal, $wdBorderVertical, $wdBorderDiagonalUp, $wdBorderDiagonalDown. linestyle, linewidth and color will be recycled to the required dimension.

align
a character out of "l", "c", "r" setting the horizontal alignment of the cell range.

Value

Details

Cell range selecting might be complicated. This function makes it easy.

See Also

WrdTable

Examples

Run this code
## Not run:    # Windows-specific example
# 
# m <- matrix(rnorm(12)*100, nrow=4,
#             dimnames=list(LETTERS[1:4], c("Variable","Value","Remark")))
# 
# wrd <- GetNewWrd()
# wt <- ToWrd(m)
# 
# WrdFormatCells(wt, rstart=c(3,1), rend=c(4,3),
#                bg=wdConst$wdColorGold, font=list(name="Arial Narrow", bold=TRUE),
#                align="c", border=list(color=wdConst$wdColorTeal,
#                                       linewidth=wdConst$wdLineWidth300pt))
# 
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace