Hello from Steved
Please how can I tell the below code that if "L [0-9 ]" is not found ignore
and goto "R [0-9 ]"
Thankyou.
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=2
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "R [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=2
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Tony Jollans - 17 Jan 2008 18:53 GMT
If Selection.Find.Execute = true Then
' Found so do whatever
Else
' Not found so don't do it
End If
' Get on with your life
The code you have looks like it has been recorded and it would probably be
as well to rework it so it wasn't emulating cursor movementand working with
Lines which are fickle things in Word - your Delete, for example, may or may
not make enough room on the line for the first word on the next line to flow
up.

Signature
Enjoy,
Tony
> Hello from Steved
>
[quoted text clipped - 44 lines]
> Selection.Delete Unit:=wdCharacter, Count:=1
> Selection.HomeKey Unit:=wdLine
Steved - 17 Jan 2008 19:02 GMT
Thankyou
> If Selection.Find.Execute = true Then
> ' Found so do whatever
[quoted text clipped - 57 lines]
> > Selection.Delete Unit:=wdCharacter, Count:=1
> > Selection.HomeKey Unit:=wdLine