S
Steved
Hello from Steved
Why am I getting an compile error: Loop without Do please.
Sub Testz()
Selection.HomeKey wdStory
Dim selstart As Long, selend As Long
With Selection.Find
Do While .Execute(FindText:="F [0-9]{1,}:[0-9]:[0-9]",
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Selection.Extend
'Once selection.extend is used then use'
selstart = Selection.Start
'then find your font and use the following lines:'
With Selection.Find.Font
.Size = 30
.Bold = True
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
Selection.Collapse wdCollapseEnd
Loop
End Sub
Why am I getting an compile error: Loop without Do please.
Sub Testz()
Selection.HomeKey wdStory
Dim selstart As Long, selend As Long
With Selection.Find
Do While .Execute(FindText:="F [0-9]{1,}:[0-9]:[0-9]",
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Selection.Extend
'Once selection.extend is used then use'
selstart = Selection.Start
'then find your font and use the following lines:'
With Selection.Find.Font
.Size = 30
.Bold = True
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
Selection.Collapse wdCollapseEnd
Loop
End Sub