2017-09-21 26 views
0

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

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页出现在任何位置... 你能帮我一个页面?谢谢!!

回答

1

如果您点击“Un titre 1”(视图模式,而不是编辑模式),将显示幻灯片2。

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

0

感谢大卫!

我明白了,但我想让文字链接到另一张幻灯片。同时我想出了如何在这个分支中执行它: https://github.com/danielinteractive/officer 函数ph_add_text2。随意将这些东西拉入你的包装中,可能其他人也需要这样做!

Cheers Daniel

+1

好的,我会添加该选项 –