Microsoft Word Macro - Find Fonts in use in a document
Posted: Wed Dec 22, 2004 12:19 pm
BB
Regular
Joined: Jun 23, 2004
Posts: 340
I found this macro (see below) to list all used fonts in a word document.
Code:
Sub ListAllUsedFonts()
' Subset of all installed fonts used in the currentdocument
'
Dim iFont As Integer
Dim iFontsUsed As Integer
Dim sResult As String
Dim sList As String
Dim bFound As Boolean
iFontsUsed = 0
sList = ""
For iFont = 1 To FontNames.Count
bFound = False
Selection.Find.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.Font.Name = FontNames(iFont)
End With
bFound = Selection.Find.Execute
If bFound Then
iFontsUsed = iFontsUsed + 1
sList = sList & FontNames(iFont) & vbCr
End If
Next iFont
Select Case iFontsUsed
Case 0
sResult = "No fonts are used in the current document."
Case 1
sResult = "The following font is used in the current document:" & vbCrLf & vbCrLf
Case Else
sResult = "The following " & iFontsUsed & " fonts are used in the current document:" & vbCrLf & vbCrLf
End Select
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest (c) 2006 by Group29 Productions.
You can syndicate Group29 Productions news with an RSS Feeder using the file backend.php