API Documentation > CorelDRAW > 2025-v26 > Shape > IVGShape
Shape.CreateEnvelope method
Creates an envelope effect
Syntax:
Function CreateEnvelope(ByVal PresetIndex As Long, Optional ByVal Mode As cdrEnvelopeMode = cdrEnvelopePutty, Optional ByVal KeepLines As Boolean = False) As Effect
Parameters:
Name Type Description
PresetIndex
Long
Mode
Specifies the type of mapping mode for the envelope, and returns cdrEnvelopeMode.
KeepLines
Boolean
Specifies whether the envelope keeps its lines straight or converts them to curves. If the KeepLines property is set to True, the envelope keeps its lines straight.
Remarks:
The CreateEnvelope method inserts a shape into a preset envelope, returning an Effect object that represents the envelope properties. Currently you can apply only a preset envelope shape, and node positions cannot be modified.
Examples:
The following VBA example draws a magnifying glass.
Sub Test()
Dim sText As Shape, sRect As Shape, sCircle1 As Shape, sCircle2 As Shape
Set sText = ActiveLayer.CreateArtisticText(2.8, 7.5, "Magnify")
With sText.Text.FontProperties
  .Name = "Arial"
  .Size = 64
End With
sText.Text.AlignProperties.Alignment = cdrCenterAlignment
sText.CreateEnvelope 4, cdrEnvelopePutty, False
ActiveDocument.ReferencePoint = cdrCenter
sText.Stretch 1, 1.6
Set sRect = ActiveLayer.CreateRectangle(2.164134, 5.358543, 6.338504, 4.798346)
With sRect
  With .Fill.ApplyFountainFill(CreateRGBColor(255, 0, 0), CreateRGBColor(251, 0, 81), , -90)

 .Colors.Add CreateRGBColor(255, 0, 0), 1

 .Colors.Add CreateRGBColor(253, 253, 213), 23

 .StartX = 4.251319

 .StartY = 5.358543

 .EndX = 4.251319

 .EndY = 4.798346
  End With
  .Rotate -60
  .Move 0.469843, -0.397559
  .Outline.Type = cdrNoOutline
End With
Set sCircle1 = ActiveLayer.CreateEllipse(1.116024, 9.514843, 4.459134, 6.171732)
sCircle1.Outline.SetProperties 0.3, OutlineStyles(0), CreateCMYKColor(0, 100, 100, 0)
Set sCircle2 = sCircle1.Duplicate
With sCircle2.Outline
  .Width = 0.05
  .Color.CMYKAssign 0, 0, 0, 0
End With
sCircle2.CreateBlend sCircle1 
End Sub