title: New Line in Rich Text Content Control of Word open xml
body: <p>I have a Word document that has a <code>Rich text Content Control</code>.</p>
  
  <p>I want to add text with new line.</p>
  
  <pre><code>using (WordprocessingDocument theDoc = WordprocessingDocument.Open(docName, true))
   {
     MainDocumentPart mainPart = theDoc.MainDocumentPart;
     foreach (SdtElement sdt in mainPart.Document.Descendants&lt;SdtElement&gt;())
       {
          SdtAlias alias = sdt.Descendants&lt;SdtAlias&gt;().FirstOrDefault();
          if (alias != null)
            {
              string sdtTitle = alias.Val.Value;
              var t = sdt.Descendants&lt;Text&gt;().FirstOrDefault();
               if (sdtTitle == "Body")
                 {
                   t.Text = "Welcome to Yazd With its winding lanes, forest of badgirs,\r\n mud-brick houses and delightful places to stay, Yazd is a 'don't miss' destination. On a flat plain ringed by mountains, \r\nthe city is wedged between the northern Dasht-e Kavir and southern Dasht-e Lut and is every inch a city of the desert." }
           }
       }
  }
  </code></pre>
  
  <p>I use a text with <code>\r\n</code> but don't add new line.</p>