title: How do we change styles in a word contentcontrol via VB.Net
body: <p>I'm trying, since a few days, to control a word document via <em>vb.net</em>. I've put some <em>contentControl</em> in it in order to mark the location where I have to make automatic changes.
  Writting in it is really easy, replacing also.
  Writting a continuous text with a lot of paragraphs is a little more tricky but I manage to do it via functions.
  Where I have more problems is by writting one title in a "Style1", a subtitle in a "Style2" and the text in "Normal style".
  When I write this :</p>
  
  <pre><code>With tfDocx.BodyCC("startFormulas").Range
      .Style = tfDocx.Doc.Styles("Titre 2")
      .Text = "Produits"
  End With
  </code></pre>
  
  <p>I have the good text in the good style. But when I add this code:</p>
  
  <pre><code>With tfDocx.BodyCC("startFormulas").Range
       .Style = tfDocx.Doc.Styles("Titre 2")
       .Text = "Produits"
  End With
  With tfDocx.BodyCC("startFormulas").Range.Characters.Last
      .InsertParagraphAfter()
      .Style = tfDocx.Doc.Styles("Titre 3")
      .Text = "essais"
  End With 
  </code></pre>
  
  <p>The .InsertParagraphAfter is not taken into account and when I debug it I have a single line "Produits essais" in my word document with needer of the two styles.
  Does someone have an idea?</p>