bottom
Great WordTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > WordTips Home > Macros > Controlling the Bold Text Attribute

Controlling the Bold Text Attribute

Summary: When processing a document in a macro, you may need to make some of your text bold. It’s easy to do using the Bold attribute, as described in this tip. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)

Word allows a rich set of formatting attributes for text in a document. You can control the bold attribute for selected text in a VBA macro by using the Bold property. The syntax is as follows:

Selection.Font.Bold = toggle

where toggle is either False (turns off the bold attribute) or True (turns on the bold attribute). If you simply simply want to change the current setting of the bold attribute—bold text becomes non-bold and vice-versa, then you can use a statement such as the following:

Selection.Font.Bold = Not Selection.Font.Bold

Tip #3425 applies to Microsoft Word versions: 97 | 2000 | 2002 | 2003 | 2007


Take Control! Master the real power behind Word! Successfully master the secrets of powerful formatting and create documents that stand out from the rest. Best of all, you can create documents that are easy to maintain and quick to change.
 
Check out WordTips: Styles and Templates today!

Helpful Links

Ask a Word Question
Make a Comment

Tips.Net Home
Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

 

Great Info!

Get tips like this every week in WordTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)