Results 1 to 7 of 7
  1. #1
    cathyj
    Guest

    Allow Page Breaks DOESN'T WORK!

    I am using Word 2000 and have VBA code that attempts to prevent a table from spliting across a page. A simplified version of this code is:

    ActiveDocument.Tables(1).AllowPageBreaks=False

    This appears to work, however, if you save and close the current document, then reopen it again, the table is split across two pages.

    Has anyone out there experienced this problem before and if so, has a solution or work around? I guess I could use paragraph formatting to keep the table from spliting, but am wondering why this command doesn't work?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Allow Page Breaks DOESN'T WORK!

    Workaround. If your table fills the full width of the page, you can use the Wrap Around property. In the Table properties dialog, it is on the Table tab, but in VBA, it is a Row property. Go figure!

    ActiveDocument.Tables(1).Rows.WrapAroundText = True

    While you're at it, make sure the rows are not allowed to break individually. I think this will do what you want.

  3. #3
    cathyj
    Guest

    Re: Allow Page Breaks DOESN'T WORK!

    When I first saw your reply, I thought "What's text wrapping around the table got to do with the price of fish in China???". But then, I tried your code and presto!

    Thanks. Is there a problem with Allow Page Breaks?

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Allow Page Breaks DOESN'T WORK!

    Something is very wrong, definitely, with these two properties. I think the lack of an interactive AllowPageBreaks property is a sign that the implementation is incomplete. All I know is, I went into help for table troubleshooting, and one thing led to another... Probably will get straightened out in the next go-round of Office.

  5. #5
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Allow Page Breaks DOESN'T WORK!

    >Probably will get straightened out in the next go-round of Office.

    <img src=/S/laugh.gif border=0 width=15 height=15> <img src=/S/rofl.gif border=0 width=15 height=15> <img src=/S/laugh.gif border=0 width=15 height=15> <img src=/S/rofl.gif border=0 width=15 height=15> <img src=/S/laugh.gif border=0 width=15 height=15> <img src=/S/rofl.gif border=0 width=15 height=15> <img src=/S/laugh.gif border=0 width=15 height=15> <img src=/S/rofl.gif border=0 width=15 height=15> <img src=/S/laugh.gif border=0 width=15 height=15> <img src=/S/rofl.gif border=0 width=15 height=15> <img src=/S/laugh.gif border=0 width=15 height=15> <img src=/S/rofl.gif border=0 width=15 height=15> <img src=/S/laugh.gif border=0 width=15 height=15> <img src=/S/rofl.gif border=0 width=15 height=15> <img src=/S/laugh.gif border=0 width=15 height=15> <img src=/S/rofl.gif border=0 width=15 height=15>
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  6. #6
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Allow Page Breaks DOESN'T WORK!

    Are those ROFL GIFs?

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Allow Page Breaks DOESN'T WORK!

    ROFLs and Laughls
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

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