Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Determining the Number of Fonts Available.
by Allen Wyatt
(last updated September 10, 2016)
There may be times within your macros when you need to determine the number of fonts available for use. To do this, use the Count property of the FontNames object, as follows:
x = FontNames.Count
When finished, x will contain the number of fonts installed and available for use.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12268) applies to Microsoft Word 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Word here: Determining the Number of Fonts Available.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Macros are often used to process information stored in documents. Usually the processing involves some sort of iterative ...Discover More
Do you need to step through a table, cell by cell, in a macro? It's easy to do using the Move method, as described in ...Discover More
If you are formatting your document by using a macro, you may need to make some of your text italics. You do that by ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.