Using the Same Font as Visio in Your Solution Dialog BoxesThis content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Microsoft Visio Standard 2002
Microsoft Visio Professional 2002
Summary: This article discusses using the new Microsoft Visio 2002 DialogFont property to make your solution dialog boxes look like Visio dialog boxes. (2 printed pages)
When you create a custom solution for Microsoft® Visio®, you usually want to integrate it as tightly as possible with Visio. One aspect of that integration is making your solution dialog boxes look like Visio dialog boxes so users can jump right in and use your solution without learning a new interface. To find out which font Visio is using, you can use the new DialogFont property.
COM provides a standard implementation of a font object with the IFontDisp interface, which exposes a font object's properties and is implemented in the stdole type library as a StdFont object creatable within Microsoft Visual Basic®.
Note The stdole type library is automatically referenced from all Visual Basic for Applications projects in Visio.
To find out what font Visio is using in its dialog boxes, you can use the StdFont object and the DialogFont property to print the font information to the Immediate window, as shown in the following example.
Sub WhatFont() Dim oStdFont As StdFont Set oStdFont = Application.DialogFont With oStdFont 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
For more information about the StdFont object, view the stdole type library in the Object Browser (Visual Basic Editor), and then examine the StdFont class.