Previous Document Next Document
ShapeRange.ApplyPatternFill

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

Member of ShapeRange

The ApplyPatternFill method applies the specified pattern fill to all of the objects in the range.

Parameters
Description
Type
Specifies the type of pattern fill and returns a value of cdrPatternFillType
FileName
Identifies the full path name of the graphic that is imported for use as a pattern fill. A file name contains the computer’s path and the name of the graphic file.
This parameter is optional.
PatternCanvasIndex
Identifies the pattern canvas in a pattern fill. Each canvas has an index number that uniquely identifies the canvas.
This parameter is optional, and its default value is 1.
FrontColor
Identifies the foreground color in a pattern fill
This parameter is optional, and its default value is Nothing.
EndColor
Identifies the background color in a pattern fill
This parameter is optional, and its default value is Nothing.
TransformWithShape
Determines whether the pattern fill changes to fit its shape when the shape object is altered. If the value is True, the pattern fill changes according to changes in its shape object.
This parameter is optional, and its default value is False.

The following code 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 2007 Corel Corporation. All rights reserved.