distribute font (from access VBA)

I need to distribute a font (from access VBA) the fomt is 3of9 barcode font...  I would like to on open of the application or frmsplash (first form) check to see if the font is present.  if not install it.
mustangcoupeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mustangcoupeAuthor Commented:
maybe using the shell commands?  But I dont know enough abou them....
0
BeldoranCommented:
Some vbscript I cut from another page, I forgot to note the url though, sorry.

Set WSHShell = CreateObject("WScript.Shell")
set FSO = CreateObject("Scripting.FileSystemObject")

sFontName = "sample.ttf"
sFontDescription = "Sample Font (TrueType)"

FSO.Copyfile "c:\" + sFontName, "c:\windows\fonts\" + sFontName
WSHShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\" + sFontDescription, sFontName

(This is vbscript, I am not certain what modifications you will need to make for access VBA, but shouldn't be too much)
0
mustangcoupeAuthor Commented:
thanks Beldoran

does anyone else knoe how I would rewrite this in VBA ( also generic for OS  if possiable, running win2000 and XP)
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

mustangcoupeAuthor Commented:
Beldoran, do you have anymore of the code or do you remember where to find it?  I need to dim the functions.
0
BeldoranCommented:
The functions are windows script host functions and should be directly accessable without extra definitions

You may want to define the variables used though

Dim WSHShell as object
Dim FSO as object
Dim sFontName, sFontDescription as string

The Microsoft notes on these functions are (note the scripting version is often much better documentation)

Regwrite
scripting version http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsMthRegWrite.asp

Copyfile
VBA version http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vamthCopyFile.asp
scripting version http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsmthcopyfile.asp
0
BeldoranCommented:
note, The code above works as is in a .vbs file that was all there was. I was going to use it in a domain logon script to install some fonts.

0
BeldoranCommented:
sorry for the many additions to this but I keep thinking of things.

The WSH - windows script host is available in 2000 and xp it is also installed (I think with later versions of IE) so should be generic.

Bel
0
mustangcoupeAuthor Commented:
Thanks but I beleive I found an answer to my problems....  http://www.accessvba.com/showthread.php?s=&threadid=9623&goto=nextoldest
0
BeldoranCommented:
Excellent, well done, they are using the windows API directly. That would work as well.
0
mustangcoupeAuthor Commented:
The only thing I would add is that you have to add the file to the table before opening the database... do in the case of my font I added a 3of9.ttf to the table (and checked the register font) and then when it opened it loaded the font as an ole object.  and then deleated the font from the directory on the unload cmd.... but it does "create it" when the file loads!
0
moduloCommented:
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.