Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2008, 12:24 PM
Registered User
 
Join Date: Jan 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default List Available Fonts in Access VBA

I need to get a list of fonts available on the system and use it in Access VBA. I think something like the code below should work, but apparently either I'm not getting the right dll or I'm not using it correctly. Can anyone help?

Thanks very much!

Public Sub ListAllFonts()

'Using Access 2003 VBA
'Added the following using Tools>References: System, System.Drawing.dll
'The Dim statements return an error of "User defined type not defined"

Dim fontCollection As New System.Drawing.Text.InstalledFontCollection
Dim fontFamily As System.Drawing.Text.FontFamily

For Each fontFamily In fontCollection
   Debug.Print fontFamily.Name
Next fontFamily

Set fontFamily = Nothing
Set fontCollection = Nothing

Exit Sub

End Sub

AppBuilder





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the Appearance of a list box (Access VBA) hewstone999 Access VBA 1 February 29th, 2008 09:12 AM
List Box Fliter MS Access VBA hewstone999 Access VBA 1 February 29th, 2008 09:01 AM
VBA access List data to text file Data-Base Access VBA 6 September 15th, 2005 04:04 PM
Beginning Access 2000 VBA Chapter 6: List Boxes greencw BOOK: Beginning Access VBA 1 June 13th, 2004 08:16 PM
VBA Access Automatic List Problem Thaleiadan Access VBA 1 March 10th, 2004 09:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.