Add quotes around selected text

K

kiwichico

Hi all, does anyone know whether it is possible to add quotes around
selected block of text by pressing a macro.
Thanks in advance,
Kiwichic
 
G

Greg Maxey

Kiwichico,

Apply this macro:

Sub QuoteSelection()
If Selection.End - Selection.Start = 0 Then Exit Sub
Selection.InsertBefore Chr$(34)
If Selection.Characters.Last.Text = " " Then _
Selection.MoveEnd wdCharacter, -1
Selection.InsertAfter Chr$(34)
Selection.Collapse wdCollapseEnd

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top