Will not Stop

S

Steved

Hello form Steved

I have more than 1 page

Each page has a Paragraph as a heading.

I'm Asking for a Border for which the below Macro does and removes the
Dashes, but it will not stop what have I done wrong Please.

Below is an example as to what I'm trying to do

12:20 RACE 1 - 11 Jul 2009 RUAK 0.0 Mdn $10000 1200 Ch : 1 (MG) (JR)
-------------------------------------------------------------------------------

Sub Boxed()
Do
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9]{1,2}:[0-9]{2}[ ^s]{1,}RACE"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found Then
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=vbTab
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find.Font
Selection.Font.Name = "Arial Black"
.Size = 18
.Bold = True
End With
With Selection.Font
With .Shading
.BackgroundPatternColor = wdColorLightYellow
End With
With .Borders(1)
.LineStyle = wdLineStyleDouble
.LineWidth = wdLineWidth150pt
End With
Selection.Font.Color = wdColorRed
Selection.Font.Size = 18
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.TypeText Text:=" "
Selection.MoveDown Unit:=wdLine, count:=3
End With
End If

Loop While Selection.Find.Found
End Sub

Thankyou.
 
P

Pesach Shelnitz

Hi,

Opps! I mixed it up. I should have written the following.
Change the line
.Wrap = wdFindContinue
to
.Wrap = wdFindStop

Sorry about the confusion.
 
S

Steved

Hello Peasach

Thankyou

Steved

Pesach Shelnitz said:
Hi,

Opps! I mixed it up. I should have written the following.
Change the line
.Wrap = wdFindContinue
to
.Wrap = wdFindStop

Sorry about the confusion.
--
Hope this helps,
Pesach Shelnitz


Steved said:
Hello form Steved

I have more than 1 page

Each page has a Paragraph as a heading.

I'm Asking for a Border for which the below Macro does and removes the
Dashes, but it will not stop what have I done wrong Please.

Below is an example as to what I'm trying to do

12:20 RACE 1 - 11 Jul 2009 RUAK 0.0 Mdn $10000 1200 Ch : 1 (MG) (JR)
-------------------------------------------------------------------------------

Sub Boxed()
Do
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[0-9]{1,2}:[0-9]{2}[ ^s]{1,}RACE"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found Then
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=vbTab
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find.Font
Selection.Font.Name = "Arial Black"
.Size = 18
.Bold = True
End With
With Selection.Font
With .Shading
.BackgroundPatternColor = wdColorLightYellow
End With
With .Borders(1)
.LineStyle = wdLineStyleDouble
.LineWidth = wdLineWidth150pt
End With
Selection.Font.Color = wdColorRed
Selection.Font.Size = 18
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.TypeText Text:=" "
Selection.MoveDown Unit:=wdLine, count:=3
End With
End If

Loop While Selection.Find.Found
End Sub

Thankyou.
 

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