debkev1010
08-01-2008, 06:25 AM
I'm using a With statement to find and replace text in a Word document; however, the Found flag is False even when the text is found/replaced -
With currentSrs.Sentences.Item(headingCount).Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "shall [" + vcrmShall
.Replacement.Text = "shall [" + requirementId
.Execute Replace:=1
End With
If (currentSrs.Sentences.Item(headingCount).Find.Found) Then
Exit For
End If
I've declared currentSrs as a Document.
Thanks,
Kevin
With currentSrs.Sentences.Item(headingCount).Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "shall [" + vcrmShall
.Replacement.Text = "shall [" + requirementId
.Execute Replace:=1
End With
If (currentSrs.Sentences.Item(headingCount).Find.Found) Then
Exit For
End If
I've declared currentSrs as a Document.
Thanks,
Kevin