Keep with Next and Merge Cells

R

Rahul

Hi,

I've a Table that I dont want to split accross pages. From one of the MVP
sites I found that the right way to do this is by unchecking the "Allow rows
to break accross pages" followed by "Keep with next" for all except the last
row.

Now I've a Table here that I did a merge cells on a few rows but only for
the first 3 columns.

The question is how do I not get the same behaviour? Which exactly is my
last row now? How does WQord handle these merged rows in its internal row
count?

Any advice?

Thanks!

-Rahul
 
L

Lene Fredborg

As I understand your question, you have vertically merged cells that span the
last rows in one or more columns in the table (e.g. a table with 3 columns,
10 rows – cells 8-10 in column 1 are merged).

Word counts the last physical cell in a column as the last cell. However, if
you turn off "Allow row to break across pages", this should prevent any cell
from breaking across pages. Therefore, seen from a logical point of view, you
should always be able to prevent the table from breaking across pages if you
apply "keep with next" to all rows until the row that contains the topmost
cell that makes up the last cell in a column (a bit difficult to explain… -
in the example above: select the first 7 rows) – this also worked
consistently for me when testing.

If you select the columns individually one by one – without the last cell –
and apply "Keep with next", this will also keep the table on one page but it
is more cumbersome.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
R

Rahul

Thanks Lene! That worked great for me.


Lene Fredborg said:
As I understand your question, you have vertically merged cells that span the
last rows in one or more columns in the table (e.g. a table with 3 columns,
10 rows – cells 8-10 in column 1 are merged).

Word counts the last physical cell in a column as the last cell. However, if
you turn off "Allow row to break across pages", this should prevent any cell
from breaking across pages. Therefore, seen from a logical point of view, you
should always be able to prevent the table from breaking across pages if you
apply "keep with next" to all rows until the row that contains the topmost
cell that makes up the last cell in a column (a bit difficult to explain… -
in the example above: select the first 7 rows) – this also worked
consistently for me when testing.

If you select the columns individually one by one – without the last cell –
and apply "Keep with next", this will also keep the table on one page but it
is more cumbersome.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
D

dschenkler

I'm having the same issue, but I want even the vertically merged cells to not break off. Is there a way for this to happen?

Thanks,
David Schenkler
 
S

Stefan Blom

You haven't cited the original post in this (possibly old) thread, so I can't
tell what has been suggested earlier. Anyway, applying "Keep with next"
paragraph formatting to whole table rows should work even with merged cells. Are
you saying that it doesn't work for you?

--
Stefan Blom
Microsoft Word MVP




wrote in message
I'm having the same issue, but I want even the vertically merged cells to not
break off. Is there a way for this to happen?

Thanks,
David Schenkler
 
D

dschenkler

Sorry, I didn't know that. I am new to this.
Yes, it did not work for me. But I decided to get rid of the code to disallow the row to break off pages, because the the table was really big, and since it ran off the page both vertically and horizontally anyway, and it looked really bad even after autofitting window and contents, I decided that not allowing the rows to break off pages was too much to ask for. Instead I am having other questions that are related to tables.

My Word template is set up so that it will merge the information from a different tool's program into MS Word. This way I get a nice report in Word. As such, I have to word the template a certain way, and then play with the document to make it look nice, hence the Macros. However, my problem lies with the tables. Sometimes there 2x2 (or bigger) tables that have the first column being labeled as what the other table will be saying.

Example:
--------------------------
|Dependents: | <<code>> |
|_____________|__________|
|Dependencies:| <<code>> |
|_____________|__________|

The <<code>> will turn into the information that is located in the other tool after running its program. My higher ups want to know two things:
1) Is there a way to make it so that if one of the cells is empty that thatentire row is deleted?
2) No one is sure if they want a certain object in the generated reports ornot. This object happens to be in a 2x2 table (as seen above). The template is simple and only 2 tables are in the template (both are the same thing,just labeled differently). But after running the tool's program, many tables will be generated. Is there a Macro code that can allow the person to decide if he/she wants these tables to be put in?

Thank you,
David Schenkler



You haven't cited the original post in this (possibly old) thread, so I can't

tell what has been suggested earlier. Anyway, applying "Keep with next"

paragraph formatting to whole table rows should work even with merged cells. Are

you saying that it doesn't work for you?



--

Stefan Blom

Microsoft Word MVP









wrote in message


I'm having the same issue, but I want even the vertically merged cells tonot

break off. Is there a way for this to happen?



Thanks,

David Schenkler
 
S

Stefan Blom

OK, so the problem is with applying "Keep with text" to merged cells in *code*.
You should ask this question in a programming group or forum, where you are more
likely to get a knowledgeable reply. You could try the programming forum at
Answers
(http://answers.microsoft.com/en-us/office/forum/customize?page=1&tab=all) or
some
MSDN forum (such as
http://social.msdn.microsoft.com/Forums/en-US/worddev/threads).

--
Stefan Blom
Microsoft Word MVP




wrote in message
Sorry, I didn't know that. I am new to this.
Yes, it did not work for me. But I decided to get rid of the code to disallow
the row to break off pages, because the the table was really big, and since it
ran off the page both vertically and horizontally anyway, and it looked really
bad even after autofitting window and contents, I decided that not allowing the
rows to break off pages was too much to ask for. Instead I am having other
questions that are related to tables.

My Word template is set up so that it will merge the information from a
different tool's program into MS Word. This way I get a nice report in Word. As
such, I have to word the template a certain way, and then play with the document
to make it look nice, hence the Macros. However, my problem lies with the
tables. Sometimes there 2x2 (or bigger) tables that have the first column being
labeled as what the other table will be saying.

Example:
--------------------------
|Dependents: | <<code>> |
|_____________|__________|
|Dependencies:| <<code>> |
|_____________|__________|

The <<code>> will turn into the information that is located in the other tool
after running its program. My higher ups want to know two things:
1) Is there a way to make it so that if one of the cells is empty that that
entire row is deleted?
2) No one is sure if they want a certain object in the generated reports or not.
This object happens to be in a 2x2 table (as seen above). The template is simple
and only 2 tables are in the template (both are the same thing, just labeled
differently). But after running the tool's program, many tables will be
generated. Is there a Macro code that can allow the person to decide if he/she
wants these tables to be put in?

Thank you,
David Schenkler



You haven't cited the original post in this (possibly old) thread, so I can't

tell what has been suggested earlier. Anyway, applying "Keep with next"

paragraph formatting to whole table rows should work even with merged cells.
Are

you saying that it doesn't work for you?



--

Stefan Blom

Microsoft Word MVP









wrote in message


I'm having the same issue, but I want even the vertically merged cells to not

break off. Is there a way for this to happen?



Thanks,

David Schenkler
 

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