B
Bruce Hensley
I am creating templates for use on our intranet using Word and Excel 2000 on
Win 2000.
I need a template to temporarily install a Type 1 font from our fileserver
for use while the document is open; I cannot have users install fonts
manually and I don't have a TrueType version.
After much Googling, the following is what I have come up with. It throws
no errors, but it always returns 0 (meaning no font installed) and the font
list in Word never shows the font.
Any suggestions or alternatives would be greatly appreciated.
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
Win 2000.
I need a template to temporarily install a Type 1 font from our fileserver
for use while the document is open; I cannot have users install fonts
manually and I don't have a TrueType version.
After much Googling, the following is what I have come up with. It throws
no errors, but it always returns 0 (meaning no font installed) and the font
list in Word never shows the font.
Any suggestions or alternatives would be greatly appreciated.
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