Cant Get out of table

S

Sukhi

I have created table

..Tables.Add rBMRange, 3, 4

populate it
rBMRange.Tables(1).Rows(intRow).Cells(1).Range.Text="xyz"
rBMRange.Tables(1).Rows.Add
intRow = intRow + 1
...
Now I want to get out of table and carry on typing --
rBMRange.Collapse Direction:=wdCollapseEnd
rBMRange.Text = vbCrLf
rBMRange.Collapse Direction:=wdCollapseEnd

This does not seem to work, it seem to put the values in Row1, Cell1.
what am i doing wrong?
 
J

Jonathan West

Hi Sukhi,

What exactly do you mean by "carry on typing". Do you mean that the macro
ends and the user continues to type manually? If so, then you need to
specify the location of the Selection object, not of your range object
variable rBMRange.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
S

Sukhi

Thanks Jonathan
No, its my vb program needs to carry on inserting more text outside of the
table.

the program inserts the table dynamically and adds rows and so on, when its
done with table it needs to carryon inseting text.

Actually, just found out the way --
rBMRange.Start = rBMRange.Tables(1).Range.End
rBMRange.Text = "xyz"
seems to work

I was wrongly using
rBMRange.Start = rBMRange.End

Thanks for your help.
 
K

Kevin B

The problem you're describing occurs when the end of file marker is in the
last cell of the last row in the table. Since you cannot type to the right
of the end of file marker, your cursor gets trapped within the table.
 
H

Helmut Weber

Hi Kevin,
The problem you're describing occurs when the end of file marker
is in the last cell of the last row in the table.
Since you cannot type to the right of the end of file marker,
your cursor gets trapped within the table.

Hmm, I wonder.
Can one get the end-of-file mark,
(last paragraph in a doc) in a cell of a table?
 
D

Doug Robbins - Word MVP

No. There will always be a paragraph after the table.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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