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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto insert page breaks.

Status
Not open for further replies.

Shamous

IS-IT--Management
Jun 23, 2001
82
0
0
US
How can I do a Find and insert a page break?

Thanks in advance.

Rusty
 
Assuming this is Word, do a find, and when you have found what you are looking for, hit CTL-ENTER, which inserts a page break.

Is that what you mean??
 
What I need to do is insert a pagebreak when I find as certain Keyword with out replacing the keyword. I need to do this automatically without any manual steps.
 
You would go to Edit, Replace. In the Find field type the word you are looking for. In the replace field type the word you are looking for and ^p^m )where ^p is a paragraph mark (enter key) ^m is the page break). -Radix lecti
 
That works. Now how about a wrinkle. I want to insert a Page Break with out actually replacing the keyword - automatically.
 
For that you would need a macro. -Radix lecti
 
Ok. So, anyone have a macro or show me how to write it. I am kind of new at Word macros

thanks
 
I just recorded this macro when carrying out the commands - Word does it all for you. I just typed some random words and decided that I wanted to find the word 'night' and then insert a page break after it.

Sub finding()
'
' finding Macro
' Macro recorded 08/01/2003
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "night"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine
Selection.InsertBreak Type:=wdPageBreak
End Sub

Have a go at doing these sorts of things and letting the program record the macros for you.

Des.

Hornchurch, ESSEX.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top