View Single Post
  #4   Report Post  
Posted to microsoft.public.word.tables
Larry Sulky Larry Sulky is offline
external usenet poster
 
Posts: 7
Default How do I lock a table (no more rows at bottom)?

On Nov 4, 10:22*am, "Jay Freedman" wrote:
* * If Not ((thisRow = thisTable.Rows.Count) And _
* * * * * * (thisCol = thisTable.Columns.Count)) Then
* * * * Selection.MoveRight Unit:=wdCell
* * Else


Say, Jay, I adapted this code to something I'm doing and I've got a
problem. My table is two columns, and in the last two rows the cells
in the right column are merged:

+----+-----+
| A | |
+----+ B |
| C | |
+----+-----+

So the Selection.MoveRight Unit:=wdCell moves the selection from Cell
A to Cell B, then to Cell C, then back to Cell B. Cell A is at
(r1,c1), B is at (r1,c2), and C is at (r2,c1). There is no cell that
has the maximum row count and the maximum column count. That is, there
is no cell at (r2,c2). So the condition in the snippet above is true
for cell B both times the selection hits it, and on the second time,
the MoveRight creates a new row.

Any way to prevent that new row from being created?
TIA
---larry