ph_with_text: add text into a new shape

Description Usage Arguments Examples

View source: R/ppt_ph_with.R

Description

add text into a new shape in a slide.

Usage

1
ph_with_text(x, str, type = "title", index = 1)

Arguments

x

a pptx device

str

text to add

type

placeholder type

index

placeholder index (integer). This is to be used when a placeholder type is not unique in the current slide, e.g. two placeholders with type 'body'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fileout <- tempfile(fileext = ".pptx")
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with_text(x = doc, type = "title", str = "Un titre")
doc <- ph_with_text(x = doc, type = "ftr", str = "pied de page")
doc <- ph_with_text(x = doc, type = "dt", str = format(Sys.Date()))
doc <- ph_with_text(x = doc, type = "sldNum", str = "slide 1")

doc <- add_slide(doc, layout = "Title Slide", master = "Office Theme")
doc <- ph_with_text(x = doc, type = "subTitle", str = "Un sous titre")
doc <- ph_with_text(x = doc, type = "ctrTitle", str = "Un titre")

print(doc, target = fileout )

Example output

[1] "/work/tmp/tmp/RtmphXm0BO/file10512fee8854.pptx"

officer documentation built on July 24, 2018, 9:02 a.m.