Fill table on word document with VBA

I have a word 2007 document (.docx) with two textboxes each containing a table
How can I reference the table cells in VBA in order to insert values.
Who is Participating?
GrahamSkanConnect With a Mentor RetiredCommented:
This demonstrates the method
Sub FillTbxTable()
    Dim sh As Shape
    Dim tbl As Table
    Set sh = ActiveDocument.Shapes(1)
    Set tbl = sh.TextFrame.TextRange.Tables(1)
    tbl.Cell(1, 2).Range.Text = "Row1 Col2"
End Sub

Open in new window

jking1234Author Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.