Searching font names
When I look at font names they sometimes have a prefix or suffix such as “Cambria (Heading)”, “(Body) Calibri” or “(Default) Times New Roman”.
I want to search for text with specific fonts in VBA but while I can search for the font name such as Calibri but it will not find text with the font “(Body) Calibri”, nor can I find it by setting sFontName = "(Body) Calibri". How can I find these fonts
My code is:
sFontName = "Calibri"
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Replacement.Text = ""
.Format = True
.Text = ""
.Font.Name = sFontName
.Execute
End With
|