Shape Class

Shape.When the object is serialized out as xml, its qualified name is p:sp.

Inheritance Hierarchy


Namespace:  DocumentFormat.OpenXml.Presentation
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)


<ChildElementInfoAttribute(GetType(NonVisualShapeProperties))> _
<ChildElementInfoAttribute(GetType(ShapeProperties))> _
<ChildElementInfoAttribute(GetType(ShapeStyle))> _
<ChildElementInfoAttribute(GetType(TextBody))> _
<ChildElementInfoAttribute(GetType(ExtensionListWithModification))> _
Public Class Shape _
    Inherits OpenXmlCompositeElement
Dim instance As Shape
public class Shape : OpenXmlCompositeElement


The following table lists the possible child types:

  • NonVisualShapeProperties <p:nvSpPr>

  • ShapeProperties <p:spPr>

  • ShapeStyle <p:style>

  • TextBody <p:txBody>

  • ExtensionListWithModification <p:extLst>

[ISO/IEC 29500-1 1st Edition] sp (Shape)

This element specifies the existence of a single shape. A shape can either be a preset or a custom geometry, defined using the DrawingML framework. In addition to a geometry each shape can have both visual and non-visual properties attached. Text and corresponding styling information can also be attached to a shape. This shape is specified along with all other shapes within either the shape tree or group shape elements.

[Note: Shapes are the preferred mechanism for specifying text on a slide. end note]

Parent Elements

grpSp (§; spTree (§

Child Elements


extLst (Extension List with Modification Flag)


nvSpPr (Non-Visual Properties for a Shape)


spPr (Shape Properties)


style (Shape Style)


txBody (Shape Text Body)




useBgFill (Use Background Fill)

Specifies that the shape fill should be set to that of the slide background surface.

[Note: This attribute does not set the fill of the shape to be transparent but instead sets it to be filled with the portion of the slide background that is directly behind it. end note]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_Shape) is located in §A.3. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


Shape Members

DocumentFormat.OpenXml.Presentation Namespace