Consulting

Results 1 to 4 of 4

Thread: Tables - cell contents spilling over to next page

  1. #1

    Tables - cell contents spilling over to next page

    Hi All,

    I am working on a Word document generated from DOORS database module. I have to format the document before it is presented to the custormers. Some of the tables in the generated Word document have a single row in two pages, which I want to tidy up. I am using the following expression:

    ActiveDocument.Styles("Table Grid").Table.AllowBreakAcrossPage = False

    This does not set the problem right. I have the following questions:

    1. Does the above code (copied from MSDN Library) apply to all the tables in the document? This does not work for me.
    2. Using the normal template of Word, this feature is built in, I expect. Because I have not seen the the contents of a single row spilling over to two pages.
    3. Or am I completely off the track?

    Please help

    - Krishna

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    1. No, it applies to all use of the Style. If a table does not use that style...it doesn't use that style. True, it is a default stykle, so it likely that all tables DO use it. However, technicaLLY, it is the style that is changed.

    2. I am not sure what you really mean by this. The default value is True. Rows will break across pages. For good reason. If they do NOT break across pages, then any text beyond what WOULD break, becomes out of sight, invisible. It disappears beyond the visible range of the cell.

    3. Hard to say. I am not clear what track you are on. What, precisely, does "tidy up" mean?

    What, precisely, would "set the problem right"?

  3. #3
    Thanks fumei, for the reply.

    I believe that I was on the wrong track using Styles to prevent from the contents of the last row of a table spilling to the next page after a page break. I used the following code and it works:

    ActiveDocument.Tables(1).Rows.AllowBreakAcrossPages = False

    "Tidy up" means that after formatting the generated Word doc , I do not want the following:
    1. No indenting of the cell contents
    2. No spilling of the last row content of a table to the next page - that is a row spanning across two pages.
    3. First row of the table - header row - appears as a first row in the page if the table spans more than one page.
    Thanks again for the reply

    - Krishna

  4. #4
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    1. Um. So don't indent them.
    2. set the table as you have done. AllowBreakAcrossPages = False
    3. set the first row as a header row. Table > Heading Row Repeat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •