API Documentation > CorelDRAW > 2025-v26 > Shape > IVGShape
Shape.Weld method
Welds shape to another object
Syntax:
Function Weld(ByVal TargetShape As Shape, Optional ByVal LeaveSource As Boolean = False, Optional ByVal LeaveTarget As Boolean = False) As Shape
Parameters:
Name Type Description
TargetShape
LeaveSource
Boolean
Specifies whether to keep an original of the welded shape.
LeaveTarget
Boolean
Specifies whether to keep the shape with which the weld was performed.
Remarks:
The Weld method welds shapes together.
Examples:
The following VBA example creates a circle and a square, and it then welds them together.
Sub Test()
Dim s1 As Shape, s2 As Shape
Dim s As Shape
Set s1 = ActiveLayer.CreateEllipse2(4, 5, 2)
Set s2 = ActiveLayer.CreateRectangle2(2, 1, 4, 4)
Set s = s1.Weld(s2)
s.Fill.UniformColor.CMYKAssign 100, 0, 0, 0 
End Sub