Install a Font

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way I can have code in an MSAccess database that can check if a
font is installed on a user's system, and if not, install the font?

I have a database I am rolling out to users that needs a bar code font that
I will provide. I'd like to have some code run on the 'splash screen' open
that will check for the font on their C drive and if it's not there, copy it
over and 'install' the font.

Any ideas?

THX guys!
 
Robert_L_Ross said:
Is there any way I can have code in an MSAccess database that can check if a
font is installed on a user's system, and if not, install the font?

I have a database I am rolling out to users that needs a bar code font that
I will provide. I'd like to have some code run on the 'splash screen' open
that will check for the font on their C drive and if it's not there, copy it
over and 'install' the font.


It probably depends on the version of Windows that you are
using. On my Win XP Pro system I can check if the font is
installed by using:
If Dir("C:\Windows\Fonts\Arial.ttf") <> "" Then
'found it
Else
'not there
End If

Again, depends on the Windows version (and your permissions)
you can install a font just be copying the font file into
that folder (using FileCopy statement).

AFAIK, there is nothing you can do from Access that will
install a font file if you do not have permission, but I am
not up to speed on security issues.
 
Marsh,

Thanks for the reply. I've found we don't really have any problems copying
the font over, but what I'm finding is that on some systems, Access won't USE
the font until the user opens the font folder (Start, Settings, Control
Panel, Fonts). Once they open that folder and 'see' the font installed,
everything works.

Do you know how I can open that folder in a 'shell' and then close
it...hopefully forcing Windows to then 'recognize' the font for use?

THX
 
John said:
Hi Marsh & Robert,

I sort of expected this. IIRC the offical way is to use the
AddFontResource API function to 'register' the new font. See e.g.
http://www.freevbcode.com/ShowCode.asp?ID=1945


Interesting. Thanks for jumping in with that info, John.

For whatever strange reason, I don't think I have ever had
to do that. Maybe because I haven't installed a font in a
long time or maybe I always checked the font folder to make
sure it was really there???
 
Back
Top