Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

distribute font (from access VBA)

Posted on 2004-10-22
12
Medium Priority
?
403 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:mustangcoupe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
12 Comments
 

Author Comment

by:mustangcoupe
ID: 12390129
maybe using the shell commands?  But I dont know enough abou them....
0
 
LVL 4

Expert Comment

by:Beldoran
ID: 12407596
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
 

Author Comment

by:mustangcoupe
ID: 12409925
thanks Beldoran

does anyone else knoe how I would rewrite this in VBA ( also generic for OS  if possiable, running win2000 and XP)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:mustangcoupe
ID: 12417169
Beldoran, do you have anymore of the code or do you remember where to find it?  I need to dim the functions.
0
 
LVL 4

Expert Comment

by:Beldoran
ID: 12417639
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
 
LVL 4

Expert Comment

by:Beldoran
ID: 12417646
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
 
LVL 4

Expert Comment

by:Beldoran
ID: 12417656
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
 

Author Comment

by:mustangcoupe
ID: 12417736
Thanks but I beleive I found an answer to my problems....  http://www.accessvba.com/showthread.php?s=&threadid=9623&goto=nextoldest
0
 
LVL 4

Expert Comment

by:Beldoran
ID: 12417799
Excellent, well done, they are using the windows API directly. That would work as well.
0
 

Author Comment

by:mustangcoupe
ID: 12418072
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
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12654110
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Simple Linear Regression

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question