PPT.AddTextBox: Adding a textbox to a slide.

View source: R/shapes.R

PPT.AddTextBoxR Documentation

Adding a textbox to a slide.

Description

Add a textbox to a slide. YOu can easily position it and modify a limited number of aspects of its appearance (color, bullet points, etc.)

Usage

PPT.AddTextBox(
  ppt,
  txt,
  width = 0.9,
  height = 0.9,
  x = "center",
  y = "center",
  xy.format = "points",
  x.offset = 0,
  y.offset = 0,
  offset.format = "points",
  x.text.align = "center",
  bullet.points = "none",
  bullet.points.color = 0,
  font.size = 16,
  font.color = "black",
  font.bold = FALSE,
  font.italic = FALSE,
  font.name = NA,
  fill.color = NA,
  border.color = NA,
  newslide = FALSE,
  maxscale = 1,
  autosize = TRUE
)

Arguments

ppt

The ppt object as used in R2PPT.

txt

Text to put into the textbox. A vector with length greater 1 is collapsed using linebreak characters.

width

Width of graphic. For values smaller than maxscale (default is 1) this refers to a proportion of the current slide's width. Values bigger than maxscale are interpreted as pixels.If NA only the height argument is used for sclaing.

height

Height of graphic. For values smaller than maxscale (default is 1) this refers to a proportion of the current slide's height. Values bigger than maxscale are interpreted as pixels. If NA only the width argument is used for scaling.

x

Horizontal placement of the textbox. Either a string ("center", "left", "right") or a numerical value. Numerical values are interpreted as absolute position in pixels counted from the left of the slide.

y

Vertical placenment of the textbox. Either a string ("center", "top", "bottom") or a numerical value. Numerical values are interpreted as absolute position in pixels counted from the top of the slide.

xy.format

The numeric x and y input will be interpreted either as "pixels" (default) or "percent" of the slide's total width/height. Character input will not be affected.

x.offset

Additional horizontal offset in pixel. Used for finetuning position on slide.

y.offset

Additional horizontal offset in pixel or as percent (see . Used for finetuning position on slide.

offset.format

The offset will be interpreted either as "pixels" (default) or "percent" of the slide's total width/height.

x.text.align

Horizontal alignment of text ("left", "center", "right").

bullet.points

Whether to treat each new line and vector element as a bullet point ("none", "unnumbered", "numbered").

bullet.points.color

Color of bullet points either as hex value or color name.

font.size

Text size (default 16).

font.color

Color of text either as hex value or color name.

font.bold

Bold text (default FALSE).

font.italic

Italic text (default FALSE).

font.name

Name of font (default NA).

fill.color

Background color either as hex value or color name.

border.color

Border line color either as hex value or color name.

newslide

Logical (default is TRUE) Whether the graphic will be placed on a new slide.

maxscale

Threshold below which values are interpreted as proportional scaling factors for the width and height argument. Above the threshold values are interpreted as pixels.

Author(s)

Mark Heckmann

Examples

## Not run: 
  
# add textbox to middle of slide
p <- PPT.Init(visible=T, method = "RDCOMClient")
p <- PPT.AddBlankSlide(p)
txt = c("Line 1", "Line 2", "Line 3")
p <- PPT.AddTextBox(p, txt) 


## End(Not run)


markheckmann/R2PPTaddons documentation built on Oct. 16, 2023, 8:03 p.m.