Hi,
I have code that actually find the 1st 'S' of the document where it will
cut and paste to new document. Can i coded in vb that it will find the next
'S' and cut and paste instead.
With Selection.Find
.Execute FindText:="<[S]????????>", MatchWildcards:=True,
MatchWholeWord:=True, Wrap:=wdFindContinue, Forward:=True
'MsgBox "!"
'Invoke the SaveAs box
With Dialogs(wdDialogFileSaveAs)
.Name = Trim$(Selection.Text)
.Show
End With
End With
Tks
regards,
Ben
Doug Robbins - 06 Feb 2005 16:05 GMT
Use this type of construction
Dim i As Long
i = 0
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="<[S]????????>", MatchWildcards:=True,
Wrap:=wdFindStop, Forward:=True) = True
i = i + 1
If i = 2 Then
Exit Do
End If
Loop
End With
MsgBox Selection.Text

Signature
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.
Hope this helps,
Doug Robbins - Word MVP
> Hi,
> I have code that actually find the 1st 'S' of the document where it will
[quoted text clipped - 17 lines]
> regards,
> Ben