Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find and replace, insert tab before | Formatting Long Documents | |||
Can't find my symbols in my insert tab | New Users | |||
Why cannot I find the Symbol dialog box in the Insert menu? | Microsoft Word Help | |||
HOW TO CREATE A DOCUMENT TO INSERT, FIND & SEND? | New Users | |||
can't find symbols in insert menu | New Users |