24-03-20 04:29 PM
25-03-20 01:03 PM
Dim d As Object = GetDocument(handle,document_name) Dim w As Object = d.Application Dim s As Object = w.Selection Dim f As Object = s.Find Try f.ClearFormatting With f .Text = Text .Replacement.Text = replacement .Forward = True .Wrap = 1 'wdFindContinue .Format = False .MatchCase = match_case .MatchWholeWord = match_whole_word .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With found = f.Execute(Replace:=2) Catch ex As Exception found = False Finally d = Nothing w = Nothing s = Nothing f = Nothing End try