title: Changing paragraph alignment of word document through VBA
body: <p>I Have excel workbook which maintains data of my customers Like address &amp; Due amount. I am writing a VBA code in excel which will generate letter to each of the customer for the due amounts.  I cannot use mailmerge because of the complexity of the letter. I am using following codes to add paragraphs</p>
  
  <pre><code>Set wrdApp = CreateObject("Word.Application")
  wrdApp.Visible = True
  Set wrdDoc = wrdApp.Documents.Add
  wrdDoc.content.InsertAfter "----------"
  wrdDoc.content.InsertParagraphAfter
  </code></pre>
  
  <p>Now I need to change alignment of paragraphs. The paragraphs in body of letter are to be justified while some paragraphs like subject line are to be center aligned. I tried this code but its not working</p>
  
  <p>1.</p>
  
  <pre><code>wrdDoc.Paragraphs(8).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
  </code></pre>
  
  <p>also</p>
  
  <p>2.</p>
  
  <pre><code>wrdDoc.Paragraphs(8).Alignment = wdAlignParagraphCenter
  </code></pre>
  
  <p>What is the correct way doing this?</p>
  
  <p>Regards
  Shekhar</p>