#1   Report Post  
Posted to microsoft.public.word.docmanagement
Allison Allison is offline
external usenet poster
 
Posts: 38
Default Find and insert

Word 2000, Windows XP SP2

Hi all,

I have a text document with hundreds of pages. I need to go through and
make sure that each new area begins a new page.

Each new area begins two lines after a row of hyphens. The row following
the row of hyphens varies, so I can't simply replace that row with the data
followed by a page break.

Any suggestions how to do this automatically or programmatically?

Sample of data:

end of prior section
------------- (entire row of hyphens)
more text here that varies
begin new section here

Thanks for your help.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Allison Allison is offline
external usenet poster
 
Posts: 38
Default Version Correction

This is Word 2003, not Word 2000. Sorry.

"Allison" wrote:

Word 2000, Windows XP SP2

Hi all,

I have a text document with hundreds of pages. I need to go through and
make sure that each new area begins a new page.

Each new area begins two lines after a row of hyphens. The row following
the row of hyphens varies, so I can't simply replace that row with the data
followed by a page break.

Any suggestions how to do this automatically or programmatically?

Sample of data:

end of prior section
------------- (entire row of hyphens)
more text here that varies
begin new section here

Thanks for your help.

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
PamC PamC is offline
external usenet poster
 
Posts: 39
Default Find and insert


If the text at the start of the new section styles as a heading style, you
can modify the style to "page break before". If you have no headings or
unique paragraph styles that can be changed, you can use a macro to put the
page breaks in. I'm no macro maven. I just recorded this macro and then
added code to make it loop. There are many excellent macro writers
providing help to this list, so someone else may chime in with something
better. If you want to try my macro, please try it on a *copy* of your
document.

*******

Sub FindNewSection()
'
' Find new section Macro
'
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "-{3,}^013*^013*^013"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Do While Selection.Find.Found
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.InsertBreak Type:=wdPageBreak
Selection.Find.Execute
Loop
End Sub


*******

PamC

"Allison" wrote:

Word 2000, Windows XP SP2

Hi all,

I have a text document with hundreds of pages. I need to go through and
make sure that each new area begins a new page.

Each new area begins two lines after a row of hyphens. The row following
the row of hyphens varies, so I can't simply replace that row with the data
followed by a page break.

Any suggestions how to do this automatically or programmatically?

Sample of data:

end of prior section
------------- (entire row of hyphens)
more text here that varies
begin new section here

Thanks for your help.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace, insert tab before Stephen K. Miyasato Formatting Long Documents 1 July 27th 06 07:25 PM
Can't find my symbols in my insert tab belchacha New Users 2 February 8th 06 09:05 PM
Why cannot I find the Symbol dialog box in the Insert menu? HD Microsoft Word Help 2 May 17th 05 10:58 PM
HOW TO CREATE A DOCUMENT TO INSERT, FIND & SEND? first timer New Users 1 March 23rd 05 10:11 PM
can't find symbols in insert menu Diana Price New Users 4 February 14th 05 06:49 AM


All times are GMT +1. The time now is 08:49 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"