我只能找到有关在reporteRs中向pptx文档添加日期(理想情况下,根据报表运行时间的当前日期)的信息。有没有办法将当前日期添加到docx文档?
谢谢!
答案 0 :(得分:2)
尝试
library( ReporteRs )
mydoc = docx( )
mydoc = addParagraph( mydoc, value = as.character(Sys.time()), stylename = "Normal" )
mydoc = addParagraph( mydoc, value = as.character(Sys.Date()), stylename = "Normal" )
writeDoc( mydoc, file = tf <- tempfile(fileext = ".docx"))
shell.exec(tf)
pptx工作just like that ...