I have the following Word VBA code which creates a word document, puts a table on each page, and anchors a textbox to each table. On pages 2-6 the textboxes are correctly anchored and appear underneath the table. But on page 1 the table is not anchored correctly, and seems to be placed at 0, 0 on the page.
Simplified code that demonstrates the issue:
Dim myDoc
Set myDoc = Documents.Add
myDoc.Select
Dim i
For i = 1 To 6
Dim aRange
Set aRange = ActiveDocument.Paragraphs.Last.Range
Dim myTable
Set myTable = myDoc.Tables.Add(aRange, 10, 10)
myTable.Columns.Width = CentimetersToPoints(0.8)
myTable.Rows.Height = CentimetersToPoints(0.8)
Dim tb
Set tb = ActiveDocument.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
Left:=0, Top:=CentimetersToPoints(1.2), Width:=CentimetersToPoints(8), Height:=CentimetersToPoints(10), _
Anchor:=myTable.Cell(10, 1).Range.Characters.First)
Set aRange = ActiveDocument.Paragraphs.Last.Range
aRange.InsertBreak
Next i
Is there a way to get page 1 to display correctly, with the textbox appearing underneath the table?