Thread: Using two fonts
View Single Post
  #9   Report Post  
Posted to microsoft.public.word.newusers
Greg
 
Posts: n/a
Default Using two fonts

Cooz,

It appears that the behavior is due to the character codes of those six
characters.

A-Z is 65 though 90. a is 97

[\]^_` are 91-96

So we can do tow passes [A-Z] and [a-z] instead of using the array
suggested earlier.

Sub TTF3()
Dim oRng As Word.Range
Dim myArray As Variant
Dim i As Long
Set oRng = ActiveDocument.Content
With oRng.Find
.MatchWildcards = True
.Text = "[A-Z]"
.Replacement.Text = "^&"
.Replacement.Font.Name = "Arial"
.Execute Replace:=wdReplaceAll
.Text = "[a-z]"
.Replacement.Text = "^&"
.Replacement.Font.Name = "Arial"
.Execute Replace:=wdReplaceAll
End With
End Sub