Previous Document Next Document

Understanding the CorelDRAW object model : Working with shapes : Determining shape type


Determining shape type

Each Shape object has a read-only Type property, which returns the shape type (for example, rectangle, ellipse, curve, text, or group). The properties and methods that are available to a shape vary with shape type; therefore, it’s a good idea to determine the shape type before applying any properties or methods to that shape.

The following sample VBA code determines whether a shape is text. If the shape is text, the code determines whether it is artistic text or paragraph text. If the shape is artistic text, it is rotated by 10 degrees.

Dim sh As Shape
Set sh = ActiveShape
If sh.Type = cdrTextShape Then
If sh.Text.IsArtisticText = True Then
sh.Rotate 10
End If
End If

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.