Previous Document Next Document

Object Model Reference : Classes : S : ShapeRange : Methods : ShapeRange.ApplyPatternFill


ShapeRange.ApplyPatternFill

Sub ApplyPatternFill(Type As cdrPatternFillType, [FileName As String], [PatternCanvasIndex As Long = 1], [FrontColor As Color], [EndColor As Color], [TransformWithShape As Boolean = False])

Description

Member of ShapeRange

The ApplyPatternFill method applies the specified pattern fill to all the shapes in a shape range.

Parameter
Description
Type
Specifies the type of pattern fill, and returns cdrPatternFillType
FileName
Specifies the full path name of the graphic to import for use as a pattern fill. The value must contain both the computer’s path and the name of the graphic file. This parameter is optional.
PatternCanvasIndex
Specifies the index number of the pattern canvas. This parameter is optional, and its default value is 1.
FrontColor
Specifies the foreground color in a pattern fill. This parameter is optional, and its default value is Nothing.
EndColor
Specifies the background color in a pattern fill. This parameter is optional, and its default value is Nothing.
TransformWithShape
Specifies whether the pattern fill changes to fit its shape when the shape is altered. If the value is True, the pattern fill changes according to changes in its shape. This parameter is optional, and its default value is False.

VBA example

The following VBA example applies a two-color pattern fill and an outline to each text shape on the page.

Sub Test()
 Dim sr As ShapeRange
 Set sr = ActivePage.FindShapes(Type:=cdrTextShape)
 sr.ApplyPatternFill cdrTwoColorPattern, , 4, CreateRGBColor(255, 0, 0)
 sr.SetOutlineProperties 0.05
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.