title: VBA/Word add bullets, numbering etc
body: <p>I have been playing with VBA code that permits automatic creation of word documents.  In the example below, I write a Word paragraph 6 times.  In order to do certain formatting (bullets, numbering, putting text in tables etc...) it appears necessary to make a second pass and apply formatting after text is created.  Can this be done in a single pass like VBA allows us to do with bold or italics?</p>
  
  <p>Example:
  - toggle numbering 
  - write line</p>
  
  <pre><code>Sub Sample()
      Dim oWordApp As Object, oWordDoc As Object
      Dim i As Integer
  
  
      '~~&gt; Establish an Word application object
      On Error Resume Next
      Set oWordApp = GetObject(, "Word.Application")
  
      If Err.Number &lt;&gt; 0 Then
          Set oWordApp = CreateObject("Word.Application")
      End If
      Err.Clear
      On Error GoTo 0
  
      oWordApp.Visible = True
  
      Set oWordDoc = oWordApp.Documents.Add
  
      With oWordDoc
          For i = 0 To 5
              .Content.InsertAfter ("Paragraph " &amp; i)
              .Content.InsertParagraphAfter
          Next
  
          ' Yields execution so that the operating system can process other events.
          DoEvents
  
          ' why does this have to be done after creating text? 
          .Paragraphs(1).Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
          ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
          False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
          wdWord10ListBehavior
  
          .Paragraphs(2).Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
          ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
          False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
          wdWord10ListBehavior
  
      End With
  
      Set oWordApp = Nothing
      Set oWordDoc = Nothing
  End Sub
  </code></pre>
  
  <p>example from <a href="https://stackoverflow.com/questions/10329871/excel-vba-for-creating-numbered-list-in-word?rq=1">Excel VBA for creating numbered list in Word</a></p>