V
vonclausowitz
Hi All,
I use following code to search in a Word document for a string of text.
Although I think it should it doesn't always finds formatted text.
Anyone know what is wromg in my code?
For Each myStoryRange In ActiveDocument.StoryRanges
With myStoryRange.Find
.Text = rstNaam("zoekstring")
.Replacement.Text = ""
.Wrap = wdFindContinue
End With
Do While Not (myStoryRange.NextStoryRange Is Nothing)
Set myStoryRange = myStoryRange.NextStoryRange
With myStoryRange.Find
.Text = rstNaam("zoekstring")
.Replacement.Text = ""
.Wrap = wdFindContinue
End With
Loop
If myStoryRange.Find.Execute = True Then
sTempNaam = rstNaam("bestandsnaam")
Exit Do
End If
Next myStoryRange
Regards
Marco
I use following code to search in a Word document for a string of text.
Although I think it should it doesn't always finds formatted text.
Anyone know what is wromg in my code?
For Each myStoryRange In ActiveDocument.StoryRanges
With myStoryRange.Find
.Text = rstNaam("zoekstring")
.Replacement.Text = ""
.Wrap = wdFindContinue
End With
Do While Not (myStoryRange.NextStoryRange Is Nothing)
Set myStoryRange = myStoryRange.NextStoryRange
With myStoryRange.Find
.Text = rstNaam("zoekstring")
.Replacement.Text = ""
.Wrap = wdFindContinue
End With
Loop
If myStoryRange.Find.Execute = True Then
sTempNaam = rstNaam("bestandsnaam")
Exit Do
End If
Next myStoryRange
Regards
Marco