Microsoft Word 2002 Macro HELP...Please rush

K

KT

I need a macro that will look for a repeating string of characters and on
the next line enter a page break. For ex, look for "00DA" and enter a page
break after it.

This will allow me to run the macro and not have to enter hundreds of page
breaks manually.

Thanks in advance.

KT
 
A

Anne Troy

Just do a find and replace. For instance, Find 00DA and replace with 00DA^m
That'll put a page break after the text 00DA.
If you need it after the LINE that contains 00DA, I suspect Find 00DA^p and
replace with 00DA^p^m
will work better for you.
************
Anne Troy
www.OfficeArticles.com
 
H

Helmut Weber

Hi KT,

like this:

Sub Macro7()
Dim oRng As Range
Set oRng = ActiveDocument.Range
ResetSearch
With oRng.Find
.Text = "quick"
.Replacement.Text = "quick" & "^m"
.Execute Replace:=wdReplaceAll
End With
ResetSearch
End Sub
' ---
Public Sub ResetSearch()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
End Sub



--
Gruß

Helmut Weber, MVP WordVBA

"red.sys" & chr$(64) & "t-online.de"
Win XP, Office 2003
 
K

KT

Thanks

Anne Troy said:
Just do a find and replace. For instance, Find 00DA and replace with 00DA^m
That'll put a page break after the text 00DA.
If you need it after the LINE that contains 00DA, I suspect Find 00DA^p and
replace with 00DA^p^m
will work better for you.
************
Anne Troy
www.OfficeArticles.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top