简体   繁体   中英

Is it possible to specify a Word template file in officer as was the case for ReportRs?

Using the older ReporteRs package, it looks like it was possible to specify a Word template with code like:

doc <- docx(template = "your template.docx")

Is it possible to specify a Word template using the newer officer package? It may be in the documentation but I don't see it. A workaround might be to read the file I want to use as a template, to delete all the content, and then to add new output to the empty file. I wouldn't want to try something like that though if it's possible just to specify a template.

Thanks.

Yes; you can open a connection to a docx template with doc <- read_docx(*your template file name here*) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM