How to detecting missing fonts?

K

kaka lu

Hi everybody:

I have a request to detect word document's missing fonts, can you help me?
 
M

macropod

Hi kaka lu,

Perhaps not quite what you're after, but here's some code to remove all text in the body of the document for which there are fonts
on the system, leaving only text in the unsupported fonts. If you combine this with change-tracking, it becomes an easy matter to
find where in the document the affect text lies by toggling the deleted text display on/off. It's also then a trivial exercise to
find out what font(s) any residual text uses.

Sub TestFonts()
Application.ScreenUpdating = False
Dim FontName As Variant
For Each FontName In FontNames
With Selection.Find
.ClearFormatting
.Font.Name = FontName
.Replacement.ClearFormatting
.Text = "?"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
Next FontName
Application.ScreenUpdating = True
End Sub

I suggest running this on a copy of the document, rather than on the original.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top