Class FillFormat (PowerPoint VBA)

The class FillFormat represents fill formatting for a shape. A shape can have a solid, gradient, texture, pattern, picture, or semi-transparent fill.


To use a FillFormat class variable it first needs to be instantiated, for example

Dim fft as FillFormat
Set fft = ActiveWindow.RangeFromPoint.Fill

The following procedures can be used to set variables of type FillFormat: ChartFormat.Fill, Shape.Fill, ShapeRange.Fill and TableBackground.Fill


Some procedures in this class have been grouped together in themes and are described on separate theme pages

Format with its procedures BackColor, ForeColor, GradientColorType, GradientStyle, OneColorGradient, TwoColorGradient and Visible
Picture with its procedures PictureEffects and UserPicture


Other Methods

PresetGradient - Sets the specified fill to a preset gradient.

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


GradientAngle returns or sets the angle of the gradient fill for the specified fill format.

ActivePresentation.Slides(1).Shapes(1).Fill.GradientAngle = 45

GradientDegree returns a value that indicates how dark or light a one-color gradient fill is.

Dim sngGradientDegree As Single
sngGradientDegree = ActivePresentation.Slides(1).Shapes(1).Fill.GradientDegree

GradientStops returns the GradientStops collection associated with the specified fill format.

Dim gssGradientStops As Office.GradientStops
Set gssGradientStops = ActivePresentation.Slides(1).Shapes(1).Fill.GradientStops

GradientVariant returns the gradient variant for the specified fill as an integer value from 1 to 4 for most gradient fills.

Dim lngGradientVariant As Long
lngGradientVariant = ActivePresentation.Slides(1).Shapes(1).Fill.GradientVariant

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.RangeFromPoint.Fill.Parent

Pattern sets or returns a value that represents the pattern applied to the specified fill.

Dim mptPattern As Office.MsoPatternType
mptPattern = ActivePresentation.Slides(1).Shapes(1).Fill.Pattern

PresetGradientType returns the preset gradient type for the specified fill.

Dim mpgPresetGradientType As Office.MsoPresetGradientType
mpgPresetGradientType = ActivePresentation.Slides(1).Shapes(1).Fill.PresetGradientType

PresetTexture returns the preset texture for the specified fill.

Dim mptPresetTexture As Office.MsoPresetTexture
mptPresetTexture = ActivePresentation.Slides(1).Shapes(1).Fill.PresetTexture

RotateWithObject returns or sets whether the fill rotates with the specified shape.

ActiveWindow.RangeFromPoint.Fill.RotateWithObject = msoTrue

TextureAlignment returns or sets the alignment (the origin of the coordinate grid) for the tiling of the texture fill.

ActiveWindow.RangeFromPoint.Fill.TextureAlignment = msoTextureAlignmentMixed

TextureHorizontalScale returns or sets the horizontal scaling factor for the texture fill.

ActiveWindow.RangeFromPoint.Fill.TextureHorizontalScale =

TextureName returns the name of the custom texture file for the specified fill.

Dim strTextureName As String
strTextureName = ActivePresentation.Slides(1).Shapes(1).Fill.TextureName

TextureOffsetX returns or sets the horizontal offset of the texture from the origin in points.

ActiveWindow.RangeFromPoint.Fill.TextureOffsetX =

TextureOffsetY returns or sets the vertical offset of the texture from the origin in points.

ActiveWindow.RangeFromPoint.Fill.TextureOffsetY =

TextureTile returns or sets whether the texture fill is tiled or centered.

ActiveWindow.RangeFromPoint.Fill.TextureTile = msoTrue

TextureType returns the texture type for the specified fill.

Dim mttTextureType As Office.MsoTextureType
mttTextureType = ActivePresentation.Slides(1).Shapes(1).Fill.TextureType

TextureVerticalScale returns or sets the vertical scaling factor for the texture fill.

ActiveWindow.RangeFromPoint.Fill.TextureVerticalScale =

Transparency returns or sets the degree of transparency of the specified fill, shadow, or line as a value between 0.0 (opaque) and 1.0 (clear).

ActivePresentation.Slides(1).Shapes(1).Fill.Transparency = 0.5

Type represent the type of fill.

Dim mftType As Office.MsoFillType
mftType = ActiveWindow.RangeFromPoint.Fill.Type