4

Is it possible to remove the number when I add a heading in a word document?

my_doc <- read_docx() %>% 
body_add_par("This is a heading", style = "heading 1")
print(my_doc, target = 'dummy.docx')

The result in word is 1. This is a heading

But I would like to have without the number: This is a heading

Bruno Guarita
  • 767
  • 10
  • 21
  • Tried to reproduce your code but I got: Error in is.character(path) : argument "path" is missing, with no default. Is the docxtractr library you used for the read_docx function? – Alessio Mar 31 '19 at 11:58

1 Answers1

1

officer uses styles from so called 'initial document' (or 'template')

When you call read_docx with unspecified path argument, empty document located in the package directory is used as intial file. So go there and edit Heading 1 style.

Łukasz Deryło
  • 1,819
  • 1
  • 16
  • 32