While typing in the header/footer will activate autoformat as you type. The
Autoformat command does not act on the header/footer view. You are therefore
going to have to use a bit of a lash-up with replace in order to replace the
straight quotes in the header/footer. The following macro should do the
trick. If there are any examples that it misses, you will have to create the
wildcard strings that ensure they are fixed. Here the body of the document
is formatted using autoformat and the header/footer with replace
Dim vFindText As Variant
Sub FixQuotes()
Dim vReplText As Variant
Dim oStory As Range
Dim i As Long
Options.AutoFormatReplaceQuotes = True
Selection.Document.Kind = wdDocumentNotSpecified
Selection.Range.AutoFormat
vFindText = Array("^034[ ^13]", "^034", "^039[ ^13]", "^039")
vReplText = Array("^0147 ", Chr(148), "^0145 ", Chr(146))
For Each oStory In ActiveDocument.StoryRanges
With oStory.Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = True
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute Replace:=wdReplaceAll
Next i
End With
Next oStory
End Sub
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Thanks very much, will check it out.
Regards
Michael Koerner
First place the insertion point in a header paragraph, and then look in the
Language dialog box (Review tab | Set Language).
The reason for my question is that "smart quotes" in Word are
language-specific, adjusting to the language at the insertion point.