WrdFormatCells.Rd
Format cells of a Word table.
WrdFormatCells(wtab, rstart, rend, col = NULL, bg = NULL,
font = NULL, border = NULL, align = NULL)
a handle to the word table as returned i.g. by WrdTable
the left/upper cell of the cell range
the right/lower cell of the cell range
the foreground colour
the background colour
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)
.
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.
a character out of "l"
, "c"
, "r"
setting the horizontal alignment of the cell range.
Cell range selecting might be complicated. This function makes it easy.
a handle to the range.
if (FALSE) # Windows-specific example
m <- matrix(rnorm(12)*100, nrow=4,
dimnames=list(LETTERS[1:4], c("Variable","Value","Remark")))
wrd <- GetNewWrd()
#> Loading required namespace: RDCOMClient
#> Warning: RDCOMClient is unfortunately not available for Linux systems (Windows-only).
wt <- ToWrd(m)
#> Error: object 'm' not found
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))
#> Error: object 'wt' not found
# \dontrun{}