![]() |
|
|
|
#1
|
||||
|
||||
|
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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
well
thank for the code but when i enter "EXT" in the input box everthing turns bold like this: 050612 EXT DKJFSDKFJSLK 21.00 FOR 21 PTS 080612 EXT OIRTYIOJBHFB 19.00 FOR 19 PTS 120612 V&V FGHFHFGHFGH 118.00 FOR 118 PTS 160612 EXT RFGJHFJMHBM 168.00 FOR 168 PTS 240612 V&V FTHFHHFGNH 365.00 FOR 18 PTS 080612 EXT OIRTYIOJBHFB 19.00 FOR 19 PTS 120612 V&V FGHFHFGHFGH 118.00 FOR 118 PTS |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bold numerals whilst typing normally! | ianl1532 | Word | 2 | 02-20-2012 10:20 PM |
How to automate BOLD in a line
|
madbrit | Word | 5 | 07-02-2011 06:43 PM |
Making Multiple Words Bold
|
mtk989 | Word | 2 | 06-25-2011 11:27 AM |
| Can't use Bold and Italic | khmerguy | Word | 3 | 03-31-2011 12:48 PM |
| Problem with Bold text in the headers | gail | Word | 0 | 04-13-2010 02:15 AM |