Hello
I have much unformated docs.
There are some headlines that should have an page break befor.
In the sample, I would have an page break befor "1.1.1.1.2 Mittelwerte für vereinbarte Partikelgrößen" , "1.2.1.1.2 Mittelwerte für vereinbarte Partikelgrößen" ( not in the sample ) and so on.
An format with the headline-format, would not work, because of more headlines with diffent names should not have an page break.
How can I achieve that?
Thanks for your help.
Page break befor headline
-
- NewLounger
- Posts: 3
- Joined: 11 Apr 2022, 08:50
Page break befor headline
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 12618
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Page break befor headline
I would do this by creating two different styles. Headline and Headline-pagebreak
StuartR
-
- NewLounger
- Posts: 3
- Joined: 11 Apr 2022, 08:50
Re: Page break befor headline
How can I define the Headline-pagebreak-style to every "Mittelwerte" Headline? Clicking on each is not the solution I am searching for.
There are 5 - 15 in every doc and about 30 doc.
Thanks
There are 5 - 15 in every doc and about 30 doc.
Thanks
-
- Administrator
- Posts: 78574
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Page break befor headline
Welcome to Eileen's Lounge!
You could run this macro:
You could run this macro:
Code: Select all
Sub AddPageBreaks()
Selection.HomeKey Unit:=wdStory
With Selection.Find
.Text = "Mittelwerte für vereinbarte Partikelgrößen"
.ClearFormatting
.Style = wdStyleHeading5
.Wrap = wdFindStop
Do While .Execute
Selection.ParagraphFormat.PageBreakBefore = True
Loop
End With
End Sub
Best wishes,
Hans
Hans
-
- NewLounger
- Posts: 3
- Joined: 11 Apr 2022, 08:50
Re: Page break befor headline
Thanks HansV
That what I was looking for and helps me so much.
That what I was looking for and helps me so much.