API Documentation > CorelDRAW > 2025-v26 > Shape > IVGShape
Shape.Trim method
Trims shape from another object
Syntax:
Function Trim(ByVal TargetShape As Shape, Optional ByVal LeaveSource As Boolean = True, Optional ByVal LeaveTarget As Boolean = False) As Shape
Parameters:
Name Type Description
TargetShape
LeaveSource
Boolean
Specifies whether to keep an original of the trimmed shape.
LeaveTarget
Boolean
Specifies whether to keep the shape with which the trim was performed.
Remarks:
The Trim method trims a shape.
Examples:
The following VBA example creates text embossed on a texturized surface.
Sub Test()
Const Offset As Double = 0.05
Dim sBase As Shape, sLight As Shape, sDark As Shape
Dim sRect As Shape
Set sRect = ActiveLayer.CreateRectangle2(0.75, 4, 7, 3)
Set sBase = ActiveLayer.CreateArtisticText(4.25, 4.75, "Bevel")
With sBase.Text
  With .FontProperties

 .Name = "Arial"

 .Size = 150

 .Style = cdrBoldFontStyle
  End With
  .AlignProperties.Alignment = cdrCenterAlignment
End With
Set sLight = sBase.Duplicate(-Offset, Offset)
Set sLight = sBase.Trim(sLight)
sLight.Fill.UniformColor.CMYKAssign 20, 0, 20, 0
Set sDark = sBase.Duplicate(Offset, -Offset)
sDark.Fill.UniformColor.CMYKAssign 100, 0, 100, 80
sBase.Trim sDark, False, False
sRect.Fill.ApplyTextureFill "Ivy on a Wall", "Samples 7" 
End Sub