Hi deepak.chawla92,
There is an existing 'Find Text' action in the MS Word VBO.
Create a duplicate copy of this action an make the below changes
shown in blue.
This is just a basic skeleton so that you can achieve what you are looking for.
You need to customise the other parameters and make changes accordingly.
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 'Remove this line
With f
.Text = Text
.Replacement.Text = "" 'Remove this line and replace with below line
.Replacement.Font.Bold = True
.Forward = True
.Wrap = 1 'wdFindContinue
.Format = False 'Remove this line
.MatchCase = match_case
.MatchWholeWord = match_whole_word
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
found = f.Execute 'make changes to this line as below
found = f.Execute(Replace:=2) '2:=wdReplaceAll
Catch ex As Exception
found = False
Finally
d = Nothing
w = Nothing
s = Nothing
f = Nothing
End try
The new action in the MS Word VBO:
View attachment 1542166844700.png
Output after running the Process:
View attachment 1542167034830.png