【发布时间】:2015-08-15 02:42:48
【问题描述】:
Set FontList = Application.CommandBars("Formatting").FindControl(ID:=1728)
' If Font control is missing, create a temp CommandBar
If FontList Is Nothing Then
Set Tempbar = Application.CommandBars.Add
Set FontList = Tempbar.Controls.Add(ID:=1728)
End If
' Put the fonts into column A
'Range("A:A").ClearContents
For i = 0 To FontList.ListCount - 1
cbmFontList.value = FontList.List(i + 1)
Next i
' Delete temp CommandBar if it exists
On Error Resume Next
Tempbar.Delete
这不起作用。我想在用户窗体上填充一个组合框并避免硬编码条目。
【问题讨论】:
-
您是在问如何将项目添加到组合框?,还是您真的在问如何在运行时枚举已安装的字体?。它们几乎不是一回事。
-
是的,你说得对,我的问题是..如何在运行时枚举已安装的字体?在我的代码中.. 因为想在组合框中的 vba 代码中使用安装字体
标签: vba