返回或设置 Variant 类型的值,该值定义了当前文档的前景色。前景色相当于文本的颜色。可读写。
expression.fgColor
expression 必选。返回 DispFPHTMLDocument 对象的表达式。
有效条目是十六进制的颜色值或枚举颜色常数。
下列示例将文档的前景色设为与蓝色对应的十六进制值,并向用户显示一条消息。
Sub SetFGColor()
'Sets the foreground color of the current document
Dim objApp As FrontPage.Application
Dim objDoc As DispFPHTMLDocument
Set objApp = FrontPage.Application
Set objDoc = objApp.ActiveDocument
'Set foreground color to blue
objDoc.fgColor = "3333FF"
MsgBox "The foreground color of the current document is now blue."
End Sub