Format related procedures in class FillFormat (PowerPoint VBA)

This page presents procedures from class FillFormat related to the theme Format: BackColor, ForeColor, GradientColorType, GradientStyle, OneColorGradient, TwoColorGradient and Visible

BackColor

Returns or sets a ColorFormat object that represents the background color for the specified fill or patterned line.

Set ActiveWindow.RangeFromPoint.Fill.BackColor = RGB(0,0,255)'blue

ForeColor

Returns or sets a ColorFormat object that represents the foreground color for the fill, line, or shadow.

Set ActiveWindow.RangeFromPoint.Fill.ForeColor = RGB(0,0,255)'blue

GradientColorType

Returns the gradient color type for the specified fill.

Use the OneColorGradient, PresetGradient, or TwoColorGradient method to set the gradient type for the fill. The value returned by the GradientColorType property can be one of these MsoGradientColorType constants.

Dim mgcGradientColorType As Office.MsoGradientColorType
mgcGradientColorType = ActivePresentation.Slides(1).Shapes(1).Fill.GradientColorType

GradientStyle

Returns the gradient style for the specified fill.

Use the OneColorGradient, PresetGradient, or TwoColorGradient method to set the gradient style for the fill. Attempting to return this property for a fill that doesn't have a gradient generates an error. Use the Type property to determine whether the fill has a gradient. The value returned by the GradientStyle property can be one of these MsoGradientStyle constants.

Dim mgsGradientStyle As Office.MsoGradientStyle
mgsGradientStyle = ActivePresentation.Slides(1).Shapes(1).Fill.GradientStyle

OneColorGradient

Sets the specified fill to a one-color gradient.

The Style parameter value can be one of these MsoGradientStyle constants.

Syntax : expression.OneColorGradient (Style, Variant, Degree)

Dim lngVariant As Long: lngVariant = 
ActivePresentation.Slides(1).Shapes(1).Fill.OneColorGradient Style:=msoGradientMixed, Variant:=lngVariant, Degree:=

Arguments

The following arguments are required:

Style (Office.MsoGradientStyle) - The gradient style.

Variant (Long) - The gradient variant. Can be a value from 1 to 4, corresponding to the four variants on the Gradient tab in the Shape Fill tab. If Style is msoGradientFromTitle or msoGradientFromCenter, this argument can be either 1 or 2.

Degree (Single) - The gradient degree. Can be a value from 0.0 (dark) to 1.0 (light).

TwoColorGradient

Sets the specified fill to a two-color gradient.

Syntax : expression.TwoColorGradient (Style, Variant)

Dim lngVariant As Long: lngVariant = 1
ActivePresentation.Slides(1).Shapes(1).Fill.TwoColorGradient Style:=msoGradientMixed, Variant:=lngVariant

Arguments

The following arguments are required:

Style (Office.MsoGradientStyle) - The gradient style.

Variant (Long) - The gradient variant. Can be from 1 to 4, corresponding to the four variants on the Gradient sub-tab on the Shape Fill tab. If Style is msoGradientFromTitle or msoGradientFromCenter, this argument can be either 1 or 2.

Visible

Returns or sets the visibility of the specified object or the formatting applied to the specified object.

The value of the Visible property can be one of these MsoTriState constants.

ActiveWindow.RangeFromPoint.Fill.Visible = msoTrue