Sub Test() Const Leaves As Long = 30 Const Radius As Double = 2 Dim stp As Double Dim i As Long Dim d As Document Dim s As Shape stp = 360 / Leaves Set d = ActiveDocument d.DrawingOriginX = 0 d.DrawingOriginY = 0 d.BeginCommandGroup "Flower" Set s = d.ActiveLayer.CreateEllipse2(0, 0, Radius) s.Fill.UniformColor.RGBAssign 100, 50, 50 Set s = d.ActiveLayer.CreateEllipse2(Radius + 0.5, 0, 0.5, 0.25) s.Fill.UniformColor.RGBAssign 255, 255, 0 s.RotationCenterX = 0 s.RotationCenterY = 0 d.ApplyToDuplicate = True For i = 1 To Leaves - 1 s.Rotate i * stp Next i d.EndCommandGroupEnd Sub
Sub Test() ActiveDocument.BeginCommandGroup "My Command" On Error Goto ErrHandler ' Some commands go here ExitSub: ActiveDocument.EndCommandGroup Exit Sub ErrHandler: MsgBox "Error occured: " & Err.Description Resume ExitSubEnd Sub