We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Search Aspose.Words.Document

Is it any way to search Aspose.Words.Document for a string? Let's say I need to do similar coding in Aspose.Words as in MS Word, is it possible? Thanks very much.

With objWord.ActiveDocument.Content.Find


.Text = "Can't open file"

.Forward = True


If .Found = True Then

convertHazard = ""

objWord.Documents.Close (SaveChanges:=Microsoft.Office.Interop.Word.WdSaveOptions.wdDoNotSaveChanges)

result = removeWord()

Exit Function

End If

End With

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You can use Replace method to achieve this. Please see the following link for more information.


I hope this could help you.

Best regards.