Group: microsoft.public.word.vba.general
From: =?Utf-8?B?U3RldmVuTQ==?=
Date: Tuesday, March 25, 2008 2:24 PM
Subject: Selection and Adding New Tables to a New Document

I’m writing a macro where I need to create a series of tables in a new MS
Word (2000) document and import text into each table. Each table needs a
number of blank lines between them. Each table has one column and three rows.
The following code worked fine for the first table.

Set oTbl = objNewDoc.Tables.Add(Range:=Selection.Range, numrows:=3,
numcolumns:=1)
oTbl.Range.Borders.Enable = False
oTbl.Cell(1, 1).Range.Text = "Add text here."
With oTbl.Cell(2, 1).Range
.Style = "Diagram"
.Text = “Add a chess diagram font text here.”
End With
oTbl.Cell(3, 1).Range.Text = “Add text here.”

But I’ve ran into two problems. How do I add blank lines (a series of empty
paragraphs) after this table? And how do I add another table following those
blank lines? I tried looping through this code a second time only to get the
second table inside the first table. I figure I’m not understanding how
“Selection” works. Any help here would be greatly appreciated.

Thanks!
Steven Craig Miller