PDA

View Full Version : Trouble when cell spans 2 pages



chrscote
05-04-2021, 08:04 AM
I have a Word Table with a number of rows that start out with just 1 cell. These rows, I have code to move down one row (to a row that contains multiple cells) and add a row above so that it contains all of the columns. I then use a copy of the text that is in the single cell into the first cell. The code then selects the entire row and merges it into 1 cell that spans all of the columns in the table.
This code works fine in MOST cases. However, if the original single cell is at the end of the page and continues to the next page moving down 1 row moves the cursor to the 2nd row of text in the same row instead of moving down to the row below that has the multiple rows. How do I test for this possibility so that I can move down another row? Would the row number be the same when I move to the 2nd page?


Chris

SamT
05-04-2021, 08:42 AM
Can the table be on its own page? With PageBreakBefore and PageBreak after?

chrscote
05-04-2021, 08:58 AM
That's another problem with this table: it takes up more than a single page. However, even if it wasn't this long, we are unable to place the table on its own page because some of the tables are only 3-4 lines long.

SamT
05-04-2021, 09:20 AM
:dunno

macropod
05-04-2021, 01:45 PM
I have code to move down one row (to a row that contains multiple cells) and add a row above so that it contains all of the columns. I then use a copy of the text that is in the single cell into the first cell. The code then selects the entire row and merges it into 1 cell that spans all of the columns in the table.
It's impossible to advise on any specific improvements to your code without seeing it. If you post it, preferably together with an attached document that contains a sample table, doubtless someone will be able to advise.