Compartir a través de


Shape Class

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

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Drawing.Spreadsheet.Shape

Namespace:  DocumentFormat.OpenXml.Drawing.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(NonVisualShapeProperties))> _
<ChildElementInfoAttribute(GetType(ShapeProperties))> _
<ChildElementInfoAttribute(GetType(ShapeStyle))> _
<ChildElementInfoAttribute(GetType(TextBody))> _
Public Class Shape _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As Shape
[ChildElementInfoAttribute(typeof(NonVisualShapeProperties))]
[ChildElementInfoAttribute(typeof(ShapeProperties))]
[ChildElementInfoAttribute(typeof(ShapeStyle))]
[ChildElementInfoAttribute(typeof(TextBody))]
public class Shape : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • NonVisualShapeProperties <xdr:nvSpPr>

  • ShapeProperties <xdr:spPr>

  • ShapeStyle <xdr:style>

  • TextBody <xdr:txBody>

[ISO/IEC 29500-1 1st Edition]

20.5.2.29 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 SpreadsheetDrawingML 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.

Parent Elements

absoluteAnchor (§20.5.2.1); grpSp (§20.5.2.17); oneCellAnchor (§20.5.2.24); twoCellAnchor (§20.5.2.33)

Child Elements

Subclause

nvSpPr (Non-Visual Properties for a Shape)

§20.5.2.23

spPr (Shape Properties)

§20.5.2.30

style (Shape Style)

§20.5.2.31

txBody (Shape Text Body)

§20.5.2.34

Attributes

Description

fLocksText (Lock Text Flag)

This attribute indicates whether to allow text editing within this drawing object when the parent worksheet is protected.

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

fPublished (Publish to Server Flag)

This attribute indicates whether the shape shall be published with the worksheet when sent to the server.

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

macro (Reference to Custom Function)

This element specifies the custom function associated with the object. [Example: A macro script, add-in function, and so on. end example]

The format of this string shall be application-defined, and should be ignored if not understood.

[Example:

< … macro="DoWork()" />

end example]

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

textlink (Text Link)

This attribute specifies a formula linking to spreadsheet cell data.

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

[Note: The W3C XML Schema definition of this element’s content model (CT_Shape) is located in §A.4.5. 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

Reference

Shape Members

DocumentFormat.OpenXml.Drawing.Spreadsheet Namespace