Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-29-2012, 06:38 AM
macropod's Avatar
macropod macropod is offline Making Line Bold Windows 7 64bit Making Line Bold Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,516
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bold numerals whilst typing normally! ianl1532 Word 2 02-20-2012 10:20 PM
Making Line Bold How to automate BOLD in a line madbrit Word 5 07-02-2011 06:43 PM
Making Line Bold 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:10 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft