Hello!
I've got a macro that adds rows to a table, but I need it to populate the rows with a document properties and I can't find a syntax that would work.
That's what I have so far:
Code:
Sub add()
Dim oTable As Table
Dim oCell As Cell
Dim oPrevRow As Row, oNewRow As Row
Dim iColumn As Long
' Insert new row
Set oTable = ActiveDocument.Tables(1)
Set oPrevRow = oTable.Rows(oTable.Rows.Count)
oTable.Rows.add
Set oNewRow = oTable.Rows(oTable.Rows.Count)
oNewRow.Cells(1).Range.Text = "Column 1 Text"
oNewRow.Cells(2).Range.Text = "Column 2 Text"
oNewRow.Cells(3).Range.Text = "Column 3 Text"
oNewRow.Cells(4).Range.Text = "Column 4 Text"
oNewRow.Cells(5).Range.Text = "Column 5 Text"
End Sub
So is there a way to replace "Column Text" string with a document property?