Application.DialogFont 属性 (Visio)

返回有关 Microsoft Visio 在其对话框中使用的字体的信息。 此为只读属性。

语法

表达式DialogFont

expression:表示 Application 对象的变量。

返回值

IFontDisp

备注

使用此属性以与 Visio 对话框相同的字体显示对话框。

COM(组件对象模型)通过基本系统字体支持和 IFontDisp 接口提供字体对象的标准实现。 IFontDisp 接口公开字体对象的属性,并在 stdole 类型库中实现为可在 Microsoft Visual Basic 中创建的 StdFont 对象。 stdole 类型库从 Visio 中的所有 Visual Basic 项目自动引用。

获取有关支持 IFontDisp 接口的 StdFont 对象的信息

  1. 在“开发工具”选项卡上的“代码”组中,选择“Visual Basic”。

  2. 在“ 视图 ”菜单上,选择“ 对象浏览器”。

  3. “项目/库 ”列表中,选择“ stdole”。

  4. “类”下,检查名为 StdFont 的类。

示例

以下示例代码演示如何获取对 StdFont 对象的引用,该对象传达有关应用程序字体的信息,以及如何将信息打印到“即时”窗口。

 
Sub DialogFont_Example() 
 
Dim objStdFont As StdFont 
Set objStdFont = Application.DialogFont 
 
 With objStdFont 
 
 Debug.Print .Bold 
 Debug.Print .CharSet 
 Debug.Print .Italic 
 Debug.Print .Name 
 Debug.Print .Size 
 Debug.Print .Strikethrough 
 Debug.Print .Underline 
 Debug.Print .Weight 
 
 End With 
 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。