ph_slidelink - 不确定如何使用它?

时间:2017-09-21 12:58:55

标签: r powerpoint officer

官员有一个功能来创建演示文稿内部幻灯片的链接。但是,我不知道如何从可用的示例中使用它。我从未看到下面示例中出现的实际超链接,例如:

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 1")
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with_text(x = doc, type = "title", str = "Un titre 2")
doc <- on_slide(doc, 1)
slide_summary(doc) # read column id here
doc <- ph_slidelink(x = doc, id_chr = "2", slide_index = 2)

print(doc, target = fileout )

在这里,我没有看到第2页的任何链接出现在任何地方...... 你能帮助我吗?谢谢!

2 个答案:

答案 0 :(得分:2)

如果单击“Un titre 1”(使用查看模式,而不是编辑模式),则会显示幻灯片2。

ph_slidelink(x = doc, id_chr = "2", slide_index = 2):点击ID为“2”的形状时,显示幻灯片2(sli​​de_index = 2)

答案 1 :(得分:1)

谢谢大卫!

我理解,但我希望将文字链接到另一张幻灯片。同时我想出了如何在这个fork中做到这一点: https://github.com/danielinteractive/officer 在函数ph_add_text2中。随意将这些东西放入你的包装中,其他人也可能需要这样做!

干杯 丹尼尔