Aspose::Words::Drawing::ShapeType enum

ShapeType enum

Specifies the type of shape in a Microsoft Word document.

enum class ShapeType

Values

NameValueDescription
Image75The shape is an image.
TextBox202The shape is a textbox. Note that shapes of many other types can also have text inside them too. A shape does not have to have this type to contain text.
Group-1The shape is a group shape.
OleObject-2The shape is an OLE object. You cannot create shapes of this type in the document.
OleControl201The shape is an ActiveX control. You cannot create shapes of this type in the document.
NonPrimitive0A shape drawn by user and consisting of multiple segments and/or vertices (curve, freeform or scribble). You cannot create shapes of this type in the document.
Rectangle1
RoundRectangle2
Ellipse3
Diamond4
Triangle5
RightTriangle6
Parallelogram7
Trapezoid8
Hexagon9
Octagon10
Plus11
Star12
Arrow13
ThickArrow14
HomePlate15
Cube16
Balloon17
Seal18
Arc19
Line20
Plaque21
Can22
Donut23
TextSimple24
TextOctagon25
TextHexagon26
TextCurve27
TextWave28
TextRing29
TextOnCurve30
TextOnRing31
StraightConnector132
BentConnector233
BentConnector334
BentConnector435
BentConnector536
CurvedConnector237
CurvedConnector338
CurvedConnector439
CurvedConnector540
Callout141
Callout242
Callout343
AccentCallout144
AccentCallout245
AccentCallout346
BorderCallout147
BorderCallout248
BorderCallout349
AccentBorderCallout150
AccentBorderCallout251
AccentBorderCallout352
Ribbon53
Ribbon254
Chevron55
Pentagon56
NoSmoking57
Seal858
Seal1659
Seal3260
WedgeRectCallout61
WedgeRRectCallout62
WedgeEllipseCallout63
Wave64
FoldedCorner65
LeftArrow66
DownArrow67
UpArrow68
LeftRightArrow69
UpDownArrow70
IrregularSeal171
IrregularSeal272
LightningBolt73
Heart74
QuadArrow76
LeftArrowCallout77
RightArrowCallout78
UpArrowCallout79
DownArrowCallout80
LeftRightArrowCallout81
UpDownArrowCallout82
QuadArrowCallout83
Bevel84
LeftBracket85
RightBracket86
LeftBrace87
RightBrace88
LeftUpArrow89
BentUpArrow90
BentArrow91
Seal2492
StripedRightArrow93
NotchedRightArrow94
BlockArc95
SmileyFace96
VerticalScroll97
HorizontalScroll98
CircularArrow99
CustomShape100This shape type seems to be set for shapes that are not part of the standard set of the auto shapes in Microsoft Word. For example, if you insert a new auto shape from ClipArt. You cannot create shapes of this type in the document.
UturnArrow101
CurvedRightArrow102
CurvedLeftArrow103
CurvedUpArrow104
CurvedDownArrow105
CloudCallout106
EllipseRibbon107
EllipseRibbon2108
FlowChartProcess109
FlowChartDecision110
FlowChartInputOutput111
FlowChartPredefinedProcess112
FlowChartInternalStorage113
FlowChartDocument114
FlowChartMultidocument115
FlowChartTerminator116
FlowChartPreparation117
FlowChartManualInput118
FlowChartManualOperation119
FlowChartConnector120
FlowChartPunchedCard121
FlowChartPunchedTape122
FlowChartSummingJunction123
FlowChartOr124
FlowChartCollate125
FlowChartSort126
FlowChartExtract127
FlowChartMerge128
FlowChartOfflineStorage129
FlowChartOnlineStorage130
FlowChartMagneticTape131
FlowChartMagneticDisk132
FlowChartMagneticDrum133
FlowChartDisplay134
FlowChartDelay135
TextPlainText136WordArt object.
TextStop137WordArt object.
TextTriangle138WordArt object.
TextTriangleInverted139WordArt object.
TextChevron140WordArt object.
TextChevronInverted141WordArt object.
TextRingInside142WordArt object.
TextRingOutside143WordArt object.
TextArchUpCurve144WordArt object.
TextArchDownCurve145WordArt object.
TextCircleCurve146WordArt object.
TextButtonCurve147WordArt object.
TextArchUpPour148WordArt object.
TextArchDownPour149WordArt object.
TextCirclePour150WordArt object.
TextButtonPour151WordArt object.
TextCurveUp152WordArt object.
TextCurveDown153WordArt object.
TextCascadeUp154WordArt object.
TextCascadeDown155WordArt object.
TextWave1156WordArt object.
TextWave2157WordArt object.
TextWave3158WordArt object.
TextWave4159WordArt object.
TextInflate160WordArt object.
TextDeflate161WordArt object.
TextInflateBottom162WordArt object.
TextDeflateBottom163WordArt object.
TextInflateTop164WordArt object.
TextDeflateTop165WordArt object.
TextDeflateInflate166WordArt object.
TextDeflateInflateDeflate167WordArt object.
TextFadeRight168WordArt object.
TextFadeLeft169WordArt object.
TextFadeUp170WordArt object.
TextFadeDown171WordArt object.
TextSlantUp172WordArt object.
TextSlantDown173WordArt object.
TextCanUp174WordArt object.
TextCanDown175WordArt object.
FlowChartAlternateProcess176
FlowChartOffpageConnector177
Callout90178
AccentCallout90179
BorderCallout90180
AccentBorderCallout90181
LeftRightUpArrow182
Sun183
Moon184
BracketPair185
BracePair186
Seal4187
DoubleWave188
ActionButtonBlank189
ActionButtonHome190
ActionButtonHelp191
ActionButtonInformation192
ActionButtonForwardNext193
ActionButtonBackPrevious194
ActionButtonEnd195
ActionButtonBeginning196
ActionButtonReturn197
ActionButtonDocument198
ActionButtonSound199
ActionButtonMovie200
SingleCornerSnipped203Snip single corner rectangle object.
TopCornersSnipped204Snip same side corner rectangle.
DiagonalCornersSnipped205Snip diagonal corner rectangle.
TopCornersOneRoundedOneSnipped206Snip and round single corner rectangle.
SingleCornerRounded207Round single corner rectangle.
TopCornersRounded208Round same side corner rectangle.
DiagonalCornersRounded209Round diagonal corner rectangle.
Heptagon210Heptagon.
Cloud211Cloud.
Seal6212Six-pointed star.
Seal7213Seven-pointed star.
Seal10214Ten-pointed star.
Seal12215Twelve-pointed star.
SwooshArrow216Swoosh arrow.
Teardrop217Teardrop.
SquareTabs218Square tabs.
PlaqueTabs219Plaque tabs.
Pie220Pie.
WedgePie221Wedge pie.
InverseLine222Inverse line.
MathPlus223Math plus.
MathMinus224Math minus.
MathMultiply225Math multiply.
MathDivide226Math divide.
MathEqual227Math equal.
MathNotEqual228Math not equal.
NonIsoscelesTrapezoid229Non-isosceles trapezoid.
LeftRightCircularArrow230Left-right circular arrow.
LeftRightRibbon231Left-right ribbon.
LeftCircularArrow232Left circular arrow.
Frame233Frame.
HalfFrame234Half frame.
Funnel235Funnel.
Gear6236Six-tooth gear.
Gear9237Nine-tooth gear.
Decagon238Decagon.
Dodecagon239Dodecagon.
DiagonalStripe240Diagonal stripe.
Corner241Corner.
CornerTabs242Corner tabs.
Chord243Chord.
ChartPlus244Chart plus.
ChartStar245Chart star.
ChartX246Chart X.
MinValuen/aReserved for the system use.

Examples

Shows how to insert a shape with an image from the local file system into a document.

auto doc = MakeObject<Document>();

// The "Shape" class's public constructor will create a shape with "ShapeMarkupLanguage.Vml" markup type.
// If you need to create a shape of a non-primitive type, such as SingleCornerSnipped, TopCornersSnipped, DiagonalCornersSnipped,
// TopCornersOneRoundedOneSnipped, SingleCornerRounded, TopCornersRounded, or DiagonalCornersRounded,
// please use DocumentBuilder.InsertShape.
auto shape = MakeObject<Shape>(doc, ShapeType::Image);
shape->get_ImageData()->SetImage(ImageDir + u"Windows MetaFile.wmf");
shape->set_Width(100);
shape->set_Height(100);

doc->get_FirstSection()->get_Body()->get_FirstParagraph()->AppendChild(shape);

doc->Save(ArtifactsDir + u"Image.FromFile.docx");

Shows how Aspose.Words identify shapes.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

builder->InsertShape(ShapeType::Heptagon, RelativeHorizontalPosition::Page, 0, RelativeVerticalPosition::Page, 0, 0, 0, WrapType::None);

builder->InsertShape(ShapeType::Cloud, RelativeHorizontalPosition::RightMargin, 0, RelativeVerticalPosition::Page, 0, 0, 0, WrapType::None);

builder->InsertShape(ShapeType::MathPlus, RelativeHorizontalPosition::RightMargin, 0, RelativeVerticalPosition::Page, 0, 0, 0, WrapType::None);

// To correct identify shape types you need to work with shapes as DML.
auto saveOptions = MakeObject<OoxmlSaveOptions>(SaveFormat::Docx);
saveOptions->set_Compliance(OoxmlCompliance::Iso29500_2008_Transitional);

doc->Save(ArtifactsDir + u"Shape.ShapeTypes.docx", saveOptions);
doc = MakeObject<Document>(ArtifactsDir + u"Shape.ShapeTypes.docx");

ArrayPtr<SharedPtr<Shape>> shapes = doc->GetChildNodes(NodeType::Shape, true)->LINQ_OfType<SharedPtr<Shape>>()->LINQ_ToArray();

for (SharedPtr<Shape> shape : shapes)
{
    std::cout << System::EnumGetName(shape->get_ShapeType()) << std::endl;
}

See Also