Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 1.5 KB

Publisher.FillFormat.ForeColor.md

File metadata and controls

60 lines (41 loc) · 1.5 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
FillFormat.ForeColor property (Publisher)
vbapb10.chm2359553
vbapb10.chm2359553
Publisher.FillFormat.ForeColor
39e7cf23-2ff8-69f3-8bf3-9051959c5418
06/07/2019
medium

FillFormat.ForeColor property (Publisher)

Returns or sets a ColorFormat object representing the foreground color for the fill, line, or shadow. Read/write.

Syntax

expression.ForeColor

expression A variable that represents a FillFormat object.

Remarks

Use the BackColor property to set the background color for a fill or line.

Example

This example adds a rectangle to the active publication and then sets the foreground color, background color, and gradient for the rectangle's fill.

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

This example adds a patterned line to the active publication.

With ActiveDocument.Pages(1).Shapes.AddLine _ 
 (BeginX:=10, BeginY:=100, EndX:=250, EndY:=0).Line 
 .Weight = 6 
 .ForeColor.RGB = RGB(0, 0, 255) 
 .BackColor.RGB = RGB(128, 0, 0) 
 .Pattern = msoPatternDarkDownwardDiagonal 
End With 

[!includeSupport and feedback]