Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2012, 12:26 PM
moishy moishy is offline Deterimine if a character is supported by a font Windows XP Deterimine if a character is supported by a font Office 2003
Novice
Deterimine if a character is supported by a font
 
Join Date: Feb 2012
Posts: 4
moishy is on a distinguished road
Exclamation Deterimine if a character is supported by a font

Hello all experts,


Recently I've come across several macros to print samples of all fonts installed on local machine, they loop thru all installed fonts and type a sample text for each one, the problem is that if the font doesn't support English (the language of the sample text) boxes show-up instead of the letters, us there a way to detect what language each font suports? If its possible then for a different language font I can have it type text in a supported language.
Here is one of the macros:




Code:
Sub FontSamples()
' Samples all fonts installed
' Macro written 31 March 2006 by John McGhie
Const SampleText As String = "the quick brown fox jumps over the lazy dog." & _
" THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 0 1 2 3 4 5 6 7 8 9"
Dim i As Long ' Make our own array because FontNames is FUBARed
Dim AllFonts() As String
Dim StyDoc As Document
Set StyDoc = Application.Documents.Add
 ' Resize the array the way we want it (in case the user has an Option Base set)
ReDim AllFonts( 1 To FontNames.Count)
 ' Load the array one by one from FontNames
For i = 1 To FontNames.Count
  AllFonts(i) = FontNames(i)
Next i
 ' Use the WordBasic sort because VBA doesn't have one!!
WordBasic.SortArray AllFonts$()
 ' Adjust the styles we want to use in the document we just created
With StyDoc.Styles
  With .Item(wdStyleHeading1)
    .Font.Color = wdColorBlue
    .ParagraphFormat.PageBreakBefore = False
  End With
  With .Item(wdStyleBodyText)
    .Font.Size = 36
    .Font.Color = wdColorAutomatic
  End With
End With
 ' Add a TOC so we can list the styles and find them later
With StyDoc.TablesOfContents
  .Add Range:=Selection.Range, RightAlignPageNumbers:= _
  True , UseHeadingStyles:= True , UpperHeadingLevel:= 1 , _
  LowerHeadingLevel:= 1 , IncludePageNumbers:= True , AddedStyles:= ""
  .Item(1).TabLeader = wdTabLeaderDots
  .Format = wdIndexIndent
End With
 ' there's a bug in FontNames collection, in WD2003 we can't  ' use For Each ... Next, it errors due to a type mismatch
For i = 1 To UBound (AllFonts)
  With Selection
    .Style = wdStyleHeading1     .TypeText Text:=AllFonts(i)
    .TypeParagraph
    .Style = wdStyleBodyText
    .Font.Name = AllFonts(i)
    .TypeText Text:=SampleText
    .TypeParagraph
    .TypeParagraph
  End With
Next i
StyDoc.TablesOfContents( 1 ).Update
Selection.HomeKey Unit:=wdStory, Extend:=wdMove
End Sub
Here are links to someother macros to accomplish the same: http://www.brainbell.com/tutorials/m...n_Your_PC.htm#
http://support.microsoft.com/default...b;en-us;209205
http://www.techrepublic.com/article/...ements/5034597
http://word.mvps.org/faqs/formatting...egenerator.htm

Last edited by moishy; 02-27-2012 at 03:53 AM. Reason: Fixed typo
Reply With Quote
  #2  
Old 02-27-2012, 12:18 AM
macropod's Avatar
macropod macropod is offline Deterimine if a character is supported by a font Windows 7 64bit Deterimine if a character is supported by a font Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: http://social.msdn.microsoft.com/For...4-c5debde0f018
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-27-2012, 02:53 AM
moishy moishy is offline Deterimine if a character is supported by a font Windows XP Deterimine if a character is supported by a font Office 2003
Novice
Deterimine if a character is supported by a font
 
Join Date: Feb 2012
Posts: 4
moishy is on a distinguished road
Default

Paul,

Thank you for pointing that out. As all can see I'm still waiting for a response at http://social.msdn.microsoft.com/For...4-c5debde0f018
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Deterimine if a character is supported by a font Character that looks like a space but isn't! simjambra Word 3 12-08-2011 04:36 PM
character set bobster Word 0 06-07-2011 10:17 AM
Deterimine if a character is supported by a font Outlook failing to render supported HTML staticrage Outlook 1 02-24-2011 07:07 AM
Bullet Character bixby Office 2 10-27-2010 02:35 PM
None of the authentication methods supported tgdonohue Outlook 1 02-06-2010 09:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft