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 / Programming / August 2007

Tip: Looking for answers? Try searching our database.

How to enum unavailable fonts in a word document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Max Liu - 22 Aug 2007 04:51 GMT
Dear friends,

I want to enum the unavailable fonts in a word cocument, but I dont want to
enum each character or word in this document.
Now, I have an alternative solution :

1. Affirm that unavailabe font exists by using Application.Dialogs with
parameter wdDialogFontSubstitution.
2. Save it as OpenXML format if this document is formated to other format.
3. Access the FontTable in this document through the System.IO.Packaging
namespace.
4. Enum each of font in the FontTable and affirm which doesnt exists in
Application.FontNames.

Here is a translation possibly.

Does the more efficient solution exist, please tell me.

TIA

Max Liu
Bob Eaton - 22 Aug 2007 13:08 GMT
I don't quite understand why you'd want all the *un*available fonts in a
document...

but a possible solution for determining the *available* fonts is:

1) Save the document as XML format (i.e. wdFormatXMLDocument)

2) Open the XML file and search in the following XPath for font names:

/w:wordDocument/w:fonts/w:defaultFonts/@w:ascii
/w:wordDocument/w:fonts/w:defaultFonts/@w:fareast
/w:wordDocument/w:fonts/w:defaultFonts/@w:h-ansi
/w:wordDocument/w:fonts/w:defaultFonts/@w:cs

as well as all instances of:

/w:wordDocument/w:fonts/w:font/@w:name

Bob

> Dear friends,
>
[quoted text clipped - 17 lines]
>
> Max Liu
 
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.