Hi Janith,
You can do this with a
wildcard Find/Replace, where:
Find = [!^13]@String*[^13]
Replace = ^&
and 'String' is the string to match with.
Here's a macro that does the same thing:
Code:
Sub MakeBold()
Application.ScreenUpdating = False
Dim StrFnd As String
StrFnd = InputBox("Please input the text for the lines to make bold", "Make Lines Bold")
If Trim(StrFnd) = "" Then Exit Sub
With ActiveDocument.Range.Find
.ClearFormatting
.Text = "[!^13]@" & StrFnd & "*[^13]"
.Replacement.ClearFormatting
.Replacement.Font.Bold = True
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
Application.ScreenUpdating = True
End Sub