I want to generate a word document from a pre saved word template, I have added placeholders on word template, but I'm not able to save the texts on placeholder location. I tried using ph_with function but it gives error as its for .pptx, please tell me which function to use for saving the desired text to a specific placeholder location. Also I'm adding the placeholders in word template by typing (Placeholder1 ...and so on) is this correct method?
template <- system.file(package = "officer", "doc_examples", "protocol_template.docx")
doc <- read_docx(path = template)
ph_with(doc,
value = input$text,
location = ph_location_label(ph_label = "Placeholder1"))