Table of contents
TOC
Collapse the table of content
Expand the table of content

ColorFormat Object (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Represents the color of a one-color object or the foreground or background color of an object with a gradient or patterned fill. You can set colors to an explicit red-green-blue value by using the RGB property.

Remarks

Use one of the properties listed in the following table to return a ColorFormat object.

Use this propertyWith this objectTo return a ColorFormat object that represents this
BackColorFillFormatBackground fill color (used in a shaded or patterned fill)
ForeColorFillFormatForeground fill color (or the fill color for a solid fill)
BackColorLineFormatBackground line color (used in a patterned line)
ForeColorLineFormatForeground line color (or the line color for a solid line)
ForeColorShadowFormatShadow color
ExtrusionColorThreeDFormatColor of the sides of an extruded object

Example

Use the RGB property to set a color to an explicit red-green-blue value. The following example adds a rectangle to the active publication and then sets the foreground color, background color, and gradient for the rectangle's fill.

Sub GradientFill() 
 With ActiveDocument.Pages(1).Shapes _ 
 .AddShape(Type:=msoShapeRectangle, _ 
 Left:=90, Top:=90, Width:=90, Height:=50).Fill 
 .ForeColor.RGB = RGB(128, 0, 0) 
 .BackColor.RGB = RGB(170, 170, 170) 
 .TwoColorGradient msoGradientHorizontal, 1 
 End With 
End Sub

Properties

Name
Application
BaseCMYK
BaseRGB
CMYK
Ink
Parent
RGB
SchemeColor
TintAndShade
Transparency
Type
© 2017 Microsoft