Returns or sets a value that determines if the font style of the font is bold.
Read-write property
object.Bold = [ value ] |
Boolean
Allows the user to select a font and displays the font details.
ShowFont Example (VBScript) | Copy Code |
---|---|
Sub ShowFont Dim pFont, blnOK Set pFont = Application.CreateAppObject ("font") blnOK = CommonDialog.ShowFont (pFont) If blnOK Then MsgBox "Here are the details of the font you selected:" & vbCrlf & _ "Bold: " & pFont.Bold & vbCrlf & _ "Charset: " & pFont.Charset & vbCrlf & _ "Italic: " & pFont.Italic & vbCrlf & _ "Name: " & pFont.Name & vbCrlf & _ "Size: " & pFont.Size & vbCrlf & _ "Strikethrough: " & pFont.StrikeThrough & vbCrlf & _ "Underlined: " & pFont.Underline & vbCrlf & _ "Weight: " & pFont.Weight, vbInformation, "Font details" Else MsgBox "No font selected. The Cancel button was pushed.", vbInformation, "No font selected" End If End Sub |