View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.vba.general
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Keeping text together on page (Office 2007)

Better if you show use the code that you are using.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Dale Fye" wrote in message
...
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