title: officer: this document contains fields that may refer to other files
body: <p>I'm creating Microsoft Word outputs using the amazing officer package in R. I'm using a template Word document to specify much of the formatting. </p>
  
  <p>Below is a code snippet that illustrates what I'm doing.</p>
  
  <pre><code>library("officer")
  
  read_docx("Output Template Blank.docx") %&gt;%
  body_add_par(value = "Kaplan-Meier Analysis of Time (Months) to HSV-2 Episodes", style = "caption") %&gt;%
  body_add_flextable(my_km_table, align = "left") %&gt;%
  print("Kaplan-Meier Output.docx")
  </code></pre>
  
  <p>This generally works very well. The only trouble is that opening the document generates an unwanted message in Word.</p>
  
  <p>"This document contains fields that may refer to other files. Do you want to update the fields in the document?"</p>
  
  <p>I can get rid of this by clicking "Yes," slightly altering the document by adding a space, and then hitting save. I'd prefer not to have to do this manually though and was hoping there is a better way. I investigated this some time back and recall that there is a way to turn this off in Microsoft Word. I also recall that this was seen as something of a security risk. I'm not sure how much of a risk. So am wondering if this could be a good solution or if there truly is a better way. </p>