ph_slidelink: slide link to a placeholder

Description Usage Arguments See Also Examples

View source: R/ppt_ph_manipulate.R

Description

add slide link to a placeholder in the current slide.

Usage

1
2
3
4
5
6
7
8
ph_slidelink(
  x,
  type = "body",
  id = 1,
  id_chr = NULL,
  ph_label = NULL,
  slide_index
)

Arguments

x

an rpptx object

type

placeholder type

id

placeholder index (integer) for a duplicated type. This is to be used when a placeholder type is not unique in the layout of the current slide, e.g. two placeholders with type 'body'. To add onto the first, use id = 1 and id = 2 for the second one. Values can be read from slide_summary.

id_chr

deprecated.

ph_label

label associated to the placeholder. Use column ph_label of result returned by slide_summary.

slide_index

slide index to reach

See Also

ph_with

Other functions for placeholders manipulation: ph_hyperlink(), ph_remove()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
fileout <- tempfile(fileext = ".pptx")
loc_title <- ph_location_type(type = "title")
doc <- read_pptx()
doc <- add_slide(doc)
doc <- ph_with(x = doc, "Un titre 1", location = loc_title)
doc <- add_slide(doc)
doc <- ph_with(x = doc, "Un titre 2", location = loc_title)
doc <- on_slide(doc, 1)
slide_summary(doc) # read column ph_label here
doc <- ph_slidelink(x = doc, ph_label = "Title 1", slide_index = 2)

print(doc, target = fileout )

officer documentation built on July 21, 2021, 5:07 p.m.