Disable Typesetting Quotes in a Template

  • Thread starter Thread starter faceman28208
  • Start date Start date
F

faceman28208

Is there any way to disable typesetting quotes in a template rather
than globally?

I have some templates where I would like there to only be straight
quotes and others templates where I'd like typesetting quotes.
 
You could use a macro to toggle between straight quotes and smart quotes,
though the macro cannot account for missing quotes when straight quotes are
converted to smart quotes and may thus produce incorrect results.
http://www.gmayor.com/installing_macro.htm

Sub ReplaceQuotes()
Dim vFindText As Variant
Dim vReplText As Variant
Dim sFormat As Boolean
Dim sQuotes As String
Dim i As Long
sQuotes = MsgBox("Click 'Yes' to convert smart quotes to straight quotes." &
vbCr & _
"Click 'No' to convert straight quotes to smart quotes.", _
vbYesNo, "Convert quotes")
sFormat = Options.AutoFormatAsYouTypeReplaceQuotes
If sQuotes = vbYes Then
vFindText = Array(Chr(147), Chr(148), Chr(145), Chr(146))
vReplText = Array(Chr(34), Chr(34), Chr(39), Chr(39))
Options.AutoFormatAsYouTypeReplaceQuotes = False
Selection.HomeKey wdStory
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute Replace:=wdReplaceAll
Next i
End With
Else
Options.AutoFormatReplaceQuotes = True
Selection.Range.AutoFormat
End If
Options.AutoFormatAsYouTypeReplaceQuotes = sFormat
End Sub

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Back
Top