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

Tips.Net > WordTips Home > Editing > Adding Quotes to Text

Adding Quotes to Text

Summary: A quick little WordBasic macro that allows you to add quotes around selected text. (This tip works with Microsoft Word 6, and Word 95.)

Normally, you add quote marks to your text as you type. There may be times, however, when you want to add the quote marks at a later time. For instance, while editing your document you may select some text and then want quote marks added around the selected text. If you are using Word 6 or Word 95, you can use the following macro, AddQuotes:

Sub MAIN
If SelType() = 2 Then
    T$ = Rtrim$(Selection$())
    If ToolsAutoCorrectSmartQuotes() Then
        BQuote$ = Chr$(147)
        EQuote$ = Chr$(148)
    Else
        BQuote$ = Chr$(34)
        EQuote$ = Chr$(34)
    End If
    EditClear
    Insert BQuote$
    Insert T$
    Insert EQuote$
End If
End Sub

This macro first checks to make sure you have selected some text. If so, then it determines the proper type of quote marks to use, based on whether you have SmartQuotes turned on or note. The selected text is then replaced with the proper quoted text.

Tip #8 applies to Microsoft Word versions: 6 | 95


Ultimate Library! The most amazing collection ever offered in the history of WordTips places every tip—present and historical—at your fingertips. Check out the WordTips Ten-Year Library.

Helpful Links

Ask a Word Question
Make a Comment

Tips.Net Home
Vital News Home

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
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.)