shape.Type
1 rectangle / 2 ellipse / 3 curve / 4 polygon / 5 bitmap / 6 text / 7 group / 8 selection.
Signature
shape.Type
Notes
1 rectangle / 2 ellipse / 3 curve / 4 polygon / 5 bitmap / 6 text / 7 group / 8 selection.
Python example (runnable)
Requires
pywin32. The example assumes app / doc / page / layer are already connected.
See Connection & InitPython
TYPE_NAME = {
1: "Rectangle", 2: "Ellipse", 3: "Curve", 4: "Polygon",
5: "Bitmap", 6: "Text", 7: "Group", 8: "Selection"
}
shape = app.ActiveSelectionRange(1)
print("Type: ", TYPE_NAME.get(shape.Type, "Other"))
if shape.Type == 6:
print("is text, so .Text is safe to read")
About this section: Enumerations
Enumerations — VBA constants and their integer values.
- This section has 9 entries; this is one of them.
- See the full section index: Enumerations
Other entries in this section
- CreateArtisticText: Alignment values1 left / 2 right / 3 center / 4 full justify / 5 force justify.
- Fill.Type0 none / 1 uniform / 2 fountain / 3 PostScript / 8 texture / 9 pattern
- Outline.Type0 = no outline. For everything else — plain, dashed, artistic — Width
- Outline.LineJoin1 = miter. Round and bevel have their own numbers.
- Outline.LineCaps0 flat / 1 round / 2 square.
- Outline.JustificationWhere the outline sits relative to the path. 2 = outside, which is wha
- doc.Unit(cdrUnit)Millimetres, inches, points, pixels and so on. The numbers can differ
- AlignToShape: type = -1Centers on both axes. That's what the title text in the code uses.