B
Bruce Hensley
I need to allow users to programmatically install a Type 1 (.PFM + .PFB)
font from our fileserver for use by a Word 2000 template on our intranet.
Our platforms are Win 2000.
I cannot target the 50-200 users who might need the template and font out of
our 2000 user base, so an automatic install triggered by loading the
template would be preferred, however, I could do it in Word VBA, VBScript,
or JScript, and as a separate install script if needed.
The installation can be permanent or temporary (for use while a document
based on the template is open).
Based on my Googling, I tried the following in VBA (within the template) for
a temporary install, but it reports 0 (no files installed).
I'm open to any suggestions or alternatives.
Thanks,
Bruce
'----------
Private Declare Function AddFontResource Lib "gdi32" Alias
"AddFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" Alias
"AddFontResourceA" (ByVal lpFileName As String) As Long
Const FONTFILE =
"\\server\share\folder\fontname.PFB|\\server\share\folder\fontname.PFM"
Dim tmp As Long
Private Sub Document_Close()
tmp = RemoveFontResource(FONTFILE)
MsgBox tmp
End Sub
Private Sub Document_New()
MsgBox FONTFILE
tmp = AddFontResource(FONTFILE)
MsgBox tmp
End Sub
Private Sub Document_Open()
tmp = AddFontResource(FONTFILE)
MsgBox tmp
End Sub
font from our fileserver for use by a Word 2000 template on our intranet.
Our platforms are Win 2000.
I cannot target the 50-200 users who might need the template and font out of
our 2000 user base, so an automatic install triggered by loading the
template would be preferred, however, I could do it in Word VBA, VBScript,
or JScript, and as a separate install script if needed.
The installation can be permanent or temporary (for use while a document
based on the template is open).
Based on my Googling, I tried the following in VBA (within the template) for
a temporary install, but it reports 0 (no files installed).
I'm open to any suggestions or alternatives.
Thanks,
Bruce
'----------
Private Declare Function AddFontResource Lib "gdi32" Alias
"AddFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" Alias
"AddFontResourceA" (ByVal lpFileName As String) As Long
Const FONTFILE =
"\\server\share\folder\fontname.PFB|\\server\share\folder\fontname.PFM"
Dim tmp As Long
Private Sub Document_Close()
tmp = RemoveFontResource(FONTFILE)
MsgBox tmp
End Sub
Private Sub Document_New()
MsgBox FONTFILE
tmp = AddFontResource(FONTFILE)
MsgBox tmp
End Sub
Private Sub Document_Open()
tmp = AddFontResource(FONTFILE)
MsgBox tmp
End Sub