title: Create word document and write formatted text
body: <pre><code>using Word = Microsoft.Office.Interop.Word;
  
  public static void CreateWord()
  {
      Word.Application objWord = new Word.Application();
      Word.Document objDoc = objWord.Documents.Add();
  
      Word.Paragraph objPara;
      objPara = objDoc.Paragraphs.Add();
      objPara.Range.Text = "Bold text aligned center";
      objPara.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;
      objPara.Range.Bold = 1;
      objPara.Range.InsertParagraphAfter();
  
      objPara = objDoc.Paragraphs.Add();
      objPara.Range.Text = "Regular text aligned left";
      objPara.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft;
      objPara.Range.Bold = 0;
      objPara.Range.InsertParagraphAfter();
  
      objPara = objDoc.Paragraphs.Add();
      objPara.Range.Text = "Regular text aligned center\nwith something on the next line";
      objPara.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;
      objPara.Range.Bold = 0;
      objPara.Range.InsertParagraphAfter();
  
      objPara = objDoc.Paragraphs.Add();
      objPara.Range.Text = "Regular text aligned left, with some Bold text here\nand some regular text on next line";
      objPara.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft;
      objPara.Range.Bold = 0;
      objPara.Range.InsertParagraphAfter();
  
      objWord.Visible = true;
      objWord.WindowState = Word.WdWindowState.wdWindowStateNormal;
  }
  </code></pre>
  
  <p>The code above creates a Word document and writes text to it, but it looks like this: <img src="https://i.stack.imgur.com/KDRRa.png" alt="Word screenshot"></p>
  
  <p>I'm assuming that text in <code>Microsoft.Office.Interop.Word</code> is not supposed to act like that, or text should be added in some other way, but I'm failing to find any good information on how to do this.</p>
  
  <p>So, my question is -  how to add text from c# to a newly created word document with the right properties, so the result looks like this: <img src="https://i.stack.imgur.com/nLacq.png" alt="Desired result"></p>
  
  <p>P.S. tips about creating tables using <code>.Interop.Word</code> would also be appreciated.</p>