Hi,
I'm looking to change all text [a-zA-Z] in equations to italics using VBA. I don't want to change anything outside of the equations in equation editor, however.
Here's my code:
This, unfortunately, changes all text to italics, and I can't figure out why...![]()
Sub Chgeqts() Dim MathObj As Object Dim intPos As Integer Dim rngObj As Range For Each MathObj In ActiveDocument.OMaths With MathObj Set rngObj = MathObj.Range .ConvertToNormalText rngObj.Font.Name = "Times New Roman" rngObj.Select With Selection.Find .Text = "[a-zA-Z]" .Replacement.Font.Italic = True .Forward = True .Wrap = wdFindContinue .Format = True .MatchWildcards = True .Execute Replace:=wdReplaceAll End With End With Next End Sub
Thank you for your help!
Bookmarks