title: Add a new paragraph in Word which includes DOCPROPERTY fields using OpenXML in C#
body: <p>I'm writing a application that can edit paragraphs in a Word Template (.docx). In these paragraphs they can contain custom DOCPROPERTY. I can read and edit the paragraph then write them back successfully, however when I write them back when a DOCPROPERTY is included it writes it back as text.</p>
  <p>An example of my code to edit a paragraph is as follows. I understand why this is happening in my code because I'm writing it as Text. my question is how I write DOCPROPERTY to a .docx file so Word reads it as DOCPROPERTY and not text.</p>
  <pre><code>     paragraph.RemoveAllChildren&lt;Run&gt;();
       paragraph.AppendChild&lt;Run&gt;(new Run(new Text(&quot;DOCPROPERTY &quot;System&quot;  \* MERGEFORMAT&quot;)));
  </code></pre>
  <p>I've searched around and cannot see a suitable example.</p>