View Single Post
  #1   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.general
Dale Fye Dale Fye is offline
external usenet poster
 
Posts: 9
Default Keeping text together on page (Office 2007)

I'm creating a Word document via Access VBA.

I have several instances where I want to ensure the text at the end of a
section is on the same page as the header of that section, and the text in
each section should never exceed a full page.

I've figured out how to use .Information( ) to get the line number of the
cursor as I build the document, so I can save the line number of the 'section
header' and then check to see whether the line number at the end of the
section is greater than that of the header. If not, I can assume the text
has wrapped over a page break.

What I'm looking for is an way to back my cursor up when this happens and
then insert lines (or a page break) until the 'section header' line starts at
the top of the next page.

----
Dale