Quotations

  • Thread starter Thread starter Shawna
  • Start date Start date
S

Shawna

Something very simple but time consuming if in quantity.
Is there a shortcut key to put a selection into quotes?
Rather than going before the first word and putting
opening quote and going to the last word and putting the
closing quote. Hope that makes sense.

Thanks in advance for any suggestions.

Shawna
 
You can add the following macro to a shortcut key of your choosing. The
macro uses smart quotes. If you prefer straight quotes change each instance
of both 147 & 148 to 34

Sub QuoteSelectionOrPrecedingWord()
If Documents.Count = 0 Then Exit Sub
If Selection.End - Selection.Start = 0 Then
With Selection
.Collapse wdCollapseEnd
Do Until .Characters.First.Previous.Text <> " "
.MoveLeft wdCharacter, 1
Loop
.InsertAfter Chr$(148)
.MoveLeft wdWord, 2
.InsertAfter Chr$(147)
.MoveRight wdCharacter, 1
.MoveRight wdWord, 1
.MoveRight wdWord, 1
End With
Else
With Selection
.InsertBefore Chr$(147)
If .Characters.Last.Text = " " Then _
.MoveEnd wdCharacter, -1
.InsertAfter Chr$(148)
.Collapse wdCollapseEnd
End With
End If
End Sub

http://www.gmayor.com/installing_macro.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 

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

Back
Top