Here are a couple of bits of code developed for other posters that will show
you how you go about doing an edit find then something right through a
document.
Sub aa()
Dim i As Long, myrange As Range
i = 1
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[0-9]{2}:[0-9]{2}:[0-9]{2}", _
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) = True
Set myrange = Selection.Range
Selection.Collapse wdCollapseEnd
Selection.MoveRight wdCharacter, 1
myrange.Text = Left(myrange.Text, 6) & Format(i, "0#")
i = i + 1
Loop
End With
End Sub
Sub aaa()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="^l([0-9]{2}.[0-9]{2}.[0-9]{4})",
ReplaceWith:="^p\1", _
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Loop
End With
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="^l", ReplaceWith:=" ", _
MatchWildcards:=False, Wrap:=wdFindContinue, Forward:=True) = True
Loop
End With
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="([0-9]{2}:[0-9]{2}) ([A-Z]{1})",
ReplaceWith:="\1^t\2", _
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Loop
End With
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="(.[0-9]{4}) ", ReplaceWith:="\1^t", _
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Loop
End With
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="(.[0-9]{4})^t([A-Z]{1})",
ReplaceWith:="\1^t^t\2", _
MatchWildcards:=True, Wrap:=wdFindContinue, Forward:=True) = True
Loop
End With
ActiveDocument.Range.ConvertToTable Separator:=vbTab, NumColumns:=3
End Sub
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP