I'm populating a MS Word table through my VB code. I'm running a "For" loop to attempt to populate the a new row for each record which is where I'm having trouble figuring out how to add a new row to the table.
Thanks in advance,
Dim WordObject As Word.Application
Set WordObject = CreateObject("Word.Application")
Printing.Show vbModeless
With WordObject
.Documents.Open ("M:\VB_Projects\AH-OOS\Reports\ViolationSheet")
.Visible = True
For i = 0 To lstViolations.ListCount - 1
.ActiveDocument.Bookmarks("txtdispostion").Select
.Selection.Text = Left(lstViolations.List(i), 2)
.ActiveDocument.Tables("Table 1").Select
.Selection.InsertRows
Next i
Set WordObject = Nothing
End With
Thanks in advance,
Dim WordObject As Word.Application
Set WordObject = CreateObject("Word.Application")
Printing.Show vbModeless
With WordObject
.Documents.Open ("M:\VB_Projects\AH-OOS\Reports\ViolationSheet")
.Visible = True
For i = 0 To lstViolations.ListCount - 1
.ActiveDocument.Bookmarks("txtdispostion").Select
.Selection.Text = Left(lstViolations.List(i), 2)
.ActiveDocument.Tables("Table 1").Select
.Selection.InsertRows
Next i
Set WordObject = Nothing
End With