title: Excel VBA to Word Doc - Changing font styles within a sentence/paragraph
body: <p>My goal is to write a sentence/paragraph with the ability to change font styles within the same sentence/paragraph. This is being done in <strong>Excel VBA</strong> and outputs in a word document (I'm sure you can tell).</p>
  
  <p>Example: "Please see <strong>Table 1</strong>. <em>Note Table 1 is assumed.</em>"</p>
  
  <p>With the code below it seems to set the whole sentence to the last wdStyleTypeCharacter that was called out.</p>
  
  <pre><code>Dim appWord As Word.Application
  Dim objDoc As Word.Document
  Set appWord = New Word.Application
  appWord.Visible = True
  Set objDoc = appWord.Documents.Add
  
  Set Normal = objDoc.Styles.Add(Name:="Normal", Type:=wdStyleTypeCharacter)
  Set Bold = objDoc.Styles.Add(Name:="Bold", Type:=wdStyleTypeCharacter)
  Set Italic = objDoc.Styles.Add(Name:="Italic", Type:=wdStyleTypeCharacter)
  
  With objDoc
  
  With .Styles(Normal)
  .Font.Name = "Arial Narrow"
  .Font.Size = 11
  .Font.Italic = False
  .Font.Bold = False
  End With
  
  With .Styles(Bold)
  .Font.Name = "Arial Narrow"
  .Font.Size = 11
  .Font.Italic = False
  .Font.Bold = True
  End With
  
  With .Styles(Italic)
  .Font.Name = "Arial Narrow"
  .Font.Size = 11
  .Font.Italic = True
  .Font.Bold = False
  End With
  
  .Content.InsertParagraphAfter
  .Range.Style = .Styles(Normal)
  .Content.InsertAfter "Please see "
  .Range.Style = .Styles(Bold)
  .Content.InsertAfter "Table 1"
  .Range.Style = .Styles(Italic)
  .Content.InsertAfter ".  Note Table 1 is assumed."
  .Content.InsertParagraphAfter
  
  End with
  
  objDoc.Close savechanges:=wdSaveChanges
  appWord.Quit
  Set objDoc = Nothing
  Set objWord = Nothing
  End Sub
  </code></pre>