Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Printing and Fonts / December 2006

Tip: Looking for answers? Try searching our database.

Which fonts are called for?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
asur - 18 Nov 2006 19:57 GMT
Is there any way of finding out which fonts are called for in a Word 97
document?
Character - 18 Nov 2006 20:43 GMT
> Is there any way of finding out which fonts are called for in a Word 97
> document?

Maybe one of the MS gurus has a better (or more technical) answer, but
a quick and dirty method (well, maybe not so quick, but definitely
dirty) would be to drag the .doc file into NOTEPAD and manually scan
for the font names, which should appear as text strings in a group
near the end of the file.

 - Character
Suzanne S. Barnhill - 18 Nov 2006 22:21 GMT
You can accomplish the same thing in Word by opening the file using the
"Recover Text from Any File" setting for "Files of type" in the Open dialog.

Signature

Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> > Is there any way of finding out which fonts are called for in a Word 97
> > document?
[quoted text clipped - 6 lines]
>
>   - Character
zzsido - 22 Nov 2006 15:45 GMT
> Is there any way of finding out which fonts are called for in a Word 97
> document?

Here is a word macro (between the two long line), if you know how to run it:
_______________________________________________________________________
Public Sub ListFontsInDoc()
'
' FontsUsed Macro
' Macro created 05.04.21
'
Dim FontList(199) As String
Dim FontCount As Integer
Dim FontName As String
Dim j As Integer, K As Integer, L As Integer
Dim X As Long, Y As Long
Dim FoundFont As Boolean
Dim rngChar As Range
Dim strFontList As String

FontCount = 0
X = ActiveDocument.Characters.Count
Y = 0
' For-Next loop through every character
For Each rngChar In ActiveDocument.Characters
Y = Y + 1
FontName = rngChar.Font.Name
StatusBar = Y & ":" & X
' check if font used for this char already in list
FoundFont = False
For j = 1 To FontCount
If FontList(j) = FontName Then FoundFont = True
Next j
If Not FoundFont Then
FontCount = FontCount + 1
FontList(FontCount) = FontName
End If
Next rngChar

' sort the list
StatusBar = "Sorting Font List"
For j = 1 To FontCount - 1
L = j
For K = j + 1 To FontCount
If FontList(L) > FontList(K) Then L = K
Next K
If j <> L Then
FontName = FontList(j)
FontList(j) = FontList(L)
FontList(L) = FontName
End If
Next j

StatusBar = ""
' put in new document
Documents.Add
Selection.TypeText Text:="There are " & FontCount & " fonts used in the
document, as follows:"
Selection.TypeParagraph
Selection.TypeParagraph
For j = 1 To FontCount
Selection.TypeText Text:=FontList(j)
Selection.TypeParagraph
Next j

End Sub
________________________________________________________________________

It will give in a new document the Menu Names of the used fonts.
If you embed into the Normal.dot, you can run anytime as needed.

zzsido
asur - 24 Nov 2006 23:19 GMT
Good macro. One problem. It does not find fonts called for in *Word Art*.
(Apparently, the fonts called for in Word Art are kept separately. Sigh.) And
I'm looking for a font used in Word Art!

P.S. The macro has a minor syntax error in this line:

Selection.TypeText Text:="There are " & FontCount & " fonts used in the
document, as follows:"

But once that's fixed it runs fine.

Thanks

> > Is there any way of finding out which fonts are called for in a Word 97
> > document?
[quoted text clipped - 67 lines]
>
> zzsido
Character - 25 Nov 2006 00:30 GMT
> Good macro. One problem. It does not find fonts called for in *Word Art*.
> (Apparently, the fonts called for in Word Art are kept separately. Sigh.) And
> I'm looking for a font used in Word Art!

The font name IS retained in the document. You can find it manually
(although it might take a while).

Open the document in notepad and look for the text of the word art.
"Happy Birthday" will appear as  "H a p p y   B i r t h d a y". The
text string immediately following will be the font name. Again, it
will appear separated like "H e l v e t i c a"

There is probably an interpretable string that defines the beginning
of a Word Art segment that would allow automation of this process; A
similar macro could then be produced or added to this one. [Well
beyond MY knowledge or ability :( ]

 - Character

> P.S. The macro has a minor syntax error in this line:
>
[quoted text clipped - 76 lines]
>>
>>zzsido
zzsido - 25 Nov 2006 06:32 GMT
> Good macro. One problem. It does not find fonts called for in *Word Art*.
> (Apparently, the fonts called for in Word Art are kept separately. Sigh.) And
[quoted text clipped - 8 lines]
>
> Thanks

The sytax error caused by Outlook Express, because of break into two lines
the originally one longer line.
I think, the WordArt embedded object (like any other OLE objects) is not act
as a simple character, therefore the macro not scan it.

I think more from this problem (embedded text-type object's scanning), but I
not give hopes of a quick result.

Zoltan
zzsido - 03 Dec 2006 07:01 GMT
Hi asur!

> Is there any way of finding out which fonts are called for in a Word 97 document?

Here is a better macro. Try this.

--------------------------------------------------------------------------------

Sub ListFontsInDoc()
'
' FontsInDocList Macro
' Macro created 06.11.30 by zzsido
'
Dim FontList(199) As String
Dim FontCount As Integer
Dim FontName As String
Dim j As Integer, k As Integer, L As Integer
Dim X As Long, Y As Long, lngJunk As Long
Dim FoundFont As Boolean
Dim rngChar As Range
Dim strFontList As String
Dim rngStory As Word.Range
Dim oShp As Shape

FontCount = 0
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType
' Iterate through all story types in the current document

For Each rngStory In ActiveDocument.StoryRanges
   'Iterate through all linked stories
 Do
   For Each rngChar In ActiveDocument.Characters
     FontName = rngChar.Font.Name
     FoundFont = False
     For j = 1 To FontCount
       If FontList(j) = FontName Then FoundFont = True
     Next j
     If Not FoundFont Then
       FontCount = FontCount + 1
       FontList(FontCount) = FontName
     End If
   Next rngChar
       
   On Error Resume Next
   Select Case rngStory.StoryType
   Case 5, 6, 7, 8, 9, 10, 11
     If rngStory.Characters.Count > 0 Then
       For Each rngChar In rngStory.Characters
         FontName = rngChar.Font.Name
         FoundFont = False
         For j = 1 To FontCount
           If FontList(j) = FontName Then FoundFont = True
         Next j
         If Not FoundFont Then
           FontCount = FontCount + 1
           FontList(FontCount) = FontName
         End If
       Next rngChar
     End If

     If rngStory.ShapeRange.Count > 0 Then
       For Each oShp In rngStory.ShapeRange
         If oShp.TextFrame.TextRange.Characters.Count > 0 Then
           For Each rngChar In oShp.TextFrame.TextRange.Characters
             FontName = rngChar.Font.Name
             FoundFont = False
             For j = 1 To FontCount
               If FontList(j) = FontName Then FoundFont = True
             Next j
             If Not FoundFont Then
               FontCount = FontCount + 1
               FontList(FontCount) = FontName
             End If
           Next rngChar
         End If
       Next
     End If
   Case Else
   End Select
   On Error GoTo 0
'   Get next linked story (if any)
   Set rngStory = rngStory.NextStoryRange
 Loop Until rngStory Is Nothing
Next

If ActiveDocument.Shapes.Count > 0 Then
 For Each oShp In ActiveDocument.Shapes
   If Left(oShp.Name, 7) = "WordArt" Then
     FontName = oShp.TextEffect.FontName
     FoundFont = False
     For j = 1 To FontCount
       If FontList(j) = FontName Then FoundFont = True
     Next j
     If Not FoundFont Then
       FontCount = FontCount + 1
       FontList(FontCount) = FontName
     End If
   End If
 Next oShp
End If

' sort the list
StatusBar = "Sorting Font List"
For j = 1 To FontCount - 1
 L = j
 For k = j + 1 To FontCount
   If FontList(L) > FontList(k) Then L = k
 Next k
 If j <> L Then
   FontName = FontList(j)
   FontList(j) = FontList(L)
   FontList(L) = FontName
 End If
Next j

StatusBar = ""
' put in new document
Documents.Add
Selection.TypeText Text:="There are " & FontCount & " fonts used " _
& "in the document (except inserted symbols), as follows:"
Selection.TypeParagraph
Selection.TypeParagraph
For j = 1 To FontCount
 Selection.TypeText Text:=FontList(j)
 Selection.TypeParagraph
Next j

End Sub

--------------------------------------------------------------------------------

Regards,
zzsido
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.