检查是否使用VBA安装了特定字体的最简单方法是什么?
最佳答案
http://www.vbcity.com/forums/topic.asp?tid=57012
重定向到
http://vbcity.com/forums/t/55257.aspx
此vb6代码与VBA兼容:
Function FontIsInstalled(sFont As String) As Boolean
'' This reference should already be set by default
'' Tools > References > OLE Automation
Dim NewFont As StdFont
On Error Resume Next
Set NewFont = New StdFont
With NewFont
' Assign the proposed font name
' Will not be assigned if font doesn't exist
.Name = sFont
' Return true if font assignment succeded
FontIsInstalled = (StrComp(sFont, .Name, vbTextCompare) = 0)
' return actual font name through arguments
sFont = .Name
End With
End Function
关于vba - 如何测试是否使用VBA安装了字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1170468/