How add new table using VBA

R

Rafal K.

I have a problem with new table:

ActiveDocument.Tables.Add range:=mysec.range, NumRows:=2, NumColumns:=2
mysec.range.InsertBefore Chr(13) & Chr(10) & "text 1"

But the "text 1" is disappearing or is in a cell (1,1) of the table.
How can I add the text before the table??
Also Do You know how put the new line to the text? Now I'm trying to put
codes in ASCII 13 and 10.
 
J

Jonathan West

Rafal K. said:
I have a problem with new table:

ActiveDocument.Tables.Add range:=mysec.range, NumRows:=2, NumColumns:=2
mysec.range.InsertBefore Chr(13) & Chr(10) & "text 1"

But the "text 1" is disappearing or is in a cell (1,1) of the table.
How can I add the text before the table??

Add the text first, and insert the table after
Also Do You know how put the new line to the text? Now I'm trying to put
codes in ASCII 13 and 10.

Use the InsertParagraphAfter method
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top