L
Lee.Hollowood
Hi,
I have tried some ways to insert a text form field into a cell of the
table but failed. Could someone give me some clues how to code it. the
text form field is inserted into 4th column.
My code is as follow:
Set otable = doc.Tables.Add(doc.Bookmarks("sii").Range, nrRow, 4)
With otable
If .Style <> "Table Grid" Then
.Style = "Table Grid"
End If
.Range.Font.Size = 10
.Range.Font.Name = "Times New Roman"
.Range.ParagraphFormat.Alignment =
Word.WdParagraphAlignment.wdAlignParagraphCenter
' Insert titles into the first cell in the second row of the table
.Cell(1, 1).Range.InsertBefore "Test Method"
.Cell(1, 2).Range.InsertBefore "Component"
.Cell(1, 3).Range.InsertBefore "Specifications"
.Cell(1, 4).Range.InsertBefore "Actual"
' Insert data into table
' the 4th column are inserted into with a text form field (shadow
area with text on it)
For i = 1 To nrRow Step 1
.Cell(i + 1, 1).Range.InsertBefore cell1(i - 1)
.Cell(i + 1, 2).Range.InsertBefore cell2(i - 1)
.Cell(i + 1, 3).Range.InsertBefore cell3(i - 1)
.Cell(i + 1, 4).Range.InsertBefore cell4(i - 1)
Next
End With
Thank you
Hollowood
I have tried some ways to insert a text form field into a cell of the
table but failed. Could someone give me some clues how to code it. the
text form field is inserted into 4th column.
My code is as follow:
Set otable = doc.Tables.Add(doc.Bookmarks("sii").Range, nrRow, 4)
With otable
If .Style <> "Table Grid" Then
.Style = "Table Grid"
End If
.Range.Font.Size = 10
.Range.Font.Name = "Times New Roman"
.Range.ParagraphFormat.Alignment =
Word.WdParagraphAlignment.wdAlignParagraphCenter
' Insert titles into the first cell in the second row of the table
.Cell(1, 1).Range.InsertBefore "Test Method"
.Cell(1, 2).Range.InsertBefore "Component"
.Cell(1, 3).Range.InsertBefore "Specifications"
.Cell(1, 4).Range.InsertBefore "Actual"
' Insert data into table
' the 4th column are inserted into with a text form field (shadow
area with text on it)
For i = 1 To nrRow Step 1
.Cell(i + 1, 1).Range.InsertBefore cell1(i - 1)
.Cell(i + 1, 2).Range.InsertBefore cell2(i - 1)
.Cell(i + 1, 3).Range.InsertBefore cell3(i - 1)
.Cell(i + 1, 4).Range.InsertBefore cell4(i - 1)
Next
End With
Thank you
Hollowood