WrdTableBorders.Rd
Drawing borders in a Word table is quite tedious. This function allows to select any range and draw border lines around it.
WrdTableBorders(wtab, from = NULL, to = NULL, border = NULL,
lty = wdConst$wdLineStyleSingle, col = wdConst$wdColorBlack,
lwd = wdConst$wdLineWidth050pt)
integer, a vector with two elements specifying the left upper bound of the cellrange.
integer, a vector with two elements specifying the right bottom of the cellrange.
a Word constant (wdConst$wdBorder...
) defining the side of the border.
a Word constant (wdConst$wdLineStyle...
) defining the line type.
a Word constant (wdConst$wdColor...
) defining the color of the border. See examples for converting R colors to Word colors.
a Word constant (wdConst$wdLineWidth...pt
) defining the line width.
nothing
if (FALSE) { # \dontrun{
# create table
tab <- table(op=d.pizza$operator, area=d.pizza$area)
# send it to Word
wrd <- GetNewWrd()
wtab <- ToWrd(tab, wrd=wrd, tablestyle = NA)
# draw borders
WrdTableBorders(wtab, from=c(2,2), to=c(3,3), border=wdConst$wdBorderBottom, wrd=wrd)
WrdTableBorders(wtab, from=c(2,2), to=c(3,3), border=wdConst$wdBorderDiagonalUp, wrd=wrd)
# demonstrate linewidth and color
wtab <- ToWrd(tab, wrd=wrd, tablestyle = NA)
WrdTableBorders(wtab, col=RgbToLong(ColToRgb("olivedrab")),
lwd=wdConst$wdLineWidth150pt, wrd=wrd)
WrdTableBorders(wtab, border=wdConst$wdBorderBottom,
col=RgbToLong(ColToRgb("dodgerblue")),
lwd=wdConst$wdLineWidth300pt, wrd=wrd)
# use an R color in Word
RgbToLong(ColToRgb("olivedrab"))
# find a similar R-color for a Word color
ColToRgb(RgbToCol(LongToRgb(wdConst$wdColorAqua)))
} # }