Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

page break before heading 2 but not heading 1 1

Status
Not open for further replies.

misterstick

Programmer
Apr 7, 2000
633
GB
using styles and/or section breaks, is there any way to have both heading 1 and heading 2 have "page break before" set to true, but to have the page break suppressed where a heading two is the next paragraph after a heading 1?

ie:

Code:
heading 1
heading 2
normal text
...

---page break----
heading 2
normal text
...

---page break----
heading 2
normal text
...

---page break----
heading 1
heading 2
normal text
...

at the moment there is always a page break between h1 and h2, leaving h1 on a page by itself.

i can do this with vba but would rather not.

many thanks,


mr s. <;)

 
I assume you are working in Excel...rather than having a heading line, why not have Heading 1 and Heading 2 at the top of your first page and then, under File, Page Setup, Sheet have Row 2 (Heading 2's line - whatever it is) as "Rows to repeat at top:"...
 
sorry, i should have looked more closely at the forum title.

this is in word 2000.

what i have is a list of sql server objects.

Code:
Tables
Table1
Table2
..
TableN

Views
View1
View2
...
ViewN

i'd like the documentation for each object to start on a separate page, but also the types of object to start a new page as well.

currently this means that the object type headers (Tabes, Views, etc,) or heading one paragraphs appear on a page by themselves.

is there a way to stop this happening?

many thanks,


mr s. <;)

 
If you are working in MS Word, then choose [Styles and Formatting] under [Format] on the menu. Select the format, choose [Modify] and then [Format]. You can now set [Page Break Before].

This will of course cause a break between heading 1 and heading 2. You'll need to individually correct those paragraphys. (If there is some clever way to avoid this last, then I'd be interested to learn it.)

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi misterstick,

You can't do it with just two styles but you could define a new style, say "Heading 2 Same Page" and base it on "Heading 2" but set "No Page Break Before". You might also set "Heading 1" style so that the next style is "Heading 2 Same Page". You could then have what you ask like this:
Code:
heading 1
heading 2 same page
normal text
...

---page break----
heading 2
normal text
...

---page break----
heading 2
normal text
...

---page break----
heading 1
heading 2 same page
normal text
...

Any changes you made to "Heading 2" would be automatically carried forward to "Heading 2 Same Page", and all the "Heading 2" and "Heading 2 Same Page" styled paragraphs would have the same Outline Level.

That's as close as I can see how to do it.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Tony's answer is the right one. Define specialized styles to handle specialized circumstances.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top