Excel vbscript返回excel中可用的字体数量

是否有可能访问Excel中可用的字体?

我意识到你可以设置字体使用:

Range("A1:C1").Select With Selection.Font .Name = "Arial" End With 

我想要做的是返回Excel中的字体数量,然后通过它们循环获取每个字体的名称。

就像是:

 For Counter = 1 To excel.fonts ActiveCell = excel.font.Name Next Counter 

这应该给计数并列出名称:

 Sub dural() Dim FontList Dim i As Long Set FontList = Application.CommandBars("Formatting").FindControl(ID:=1728) MsgBox FontList.ListCount For i = 1 To FontList.ListCount Cells(Rows.Count, 1).End(xlUp)(2) = FontList.List(i) Next i End Sub 

从一个Jeeped岗位

Jeeped Post