Hello from Steved
Sub Win2()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="F [0-9]:[0-9]:[0-9]", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Delete
Loop
End With
End Sub
How do I turn on the extend then find Font 30 and once found and highlited
move back by -2 count and then delete, and now put this in the above macro
please.
Please look at the below to give yourself an Idea as to what I am trying to
do.
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Thankyou.
SteveCalkins - 31 May 2006 09:50 GMT
If I understand what you want to do, you need to apply the extend, save the
start of the selection, find the next matter save the end of the selection
then demark the last two words and delete as follows:
Dim selstart as long, selend as long
Once selection.extend is used then use
selstart=selection.start
then find your font and use the following lines:
selend=selection.end
Activedocument.Range(selstart, selend).Select
'The above selects everything between the two search occurences
'Now deselect the items you want
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
The looping for multiple instances should be trivial. Just remember that
searching again can be problematic if you do not collapse the selection
before the search.
Best regards,
Steve Calkins
> Hello from Steved
>
[quoted text clipped - 39 lines]
>
> Thankyou.
Steved - 31 May 2006 10:13 GMT
Thankyou.
> If I understand what you want to do, you need to apply the extend, save the
> start of the selection, find the next matter save the end of the selection
[quoted text clipped - 62 lines]
> >
> > Thankyou.