ShapeStyle Class

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

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

public class ShapeStyle : OpenXmlCompositeElement

The following table lists the possible child types:

  • DocumentFormat.OpenXml.Drawing.LineReference <a:lnRef>

  • DocumentFormat.OpenXml.Drawing.FillReference <a:fillRef>

  • DocumentFormat.OpenXml.Drawing.EffectReference <a:effectRef>

  • DocumentFormat.OpenXml.Drawing.FontReference <a:fontRef>

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

This element specifies the style information for a shape. This is used to define a shape's appearance in terms of the preset styles defined by the style matrix for the theme.


  <a:lnRef idx="3">
    <a:schemeClr val="lt1"/>
  <a:fillRef idx="1">
    <a:schemeClr val="accent3"/>
  <a:effectRef idx="1">
    <a:schemeClr val="accent3"/>
  <a:fontRef idx="minor">
    <a:schemeClr val="lt1"/>

The parent shape of the above code is to have an outline that uses the third line style defined by the theme, use the first fill defined by the scheme, and be rendered with the first effect defined by the theme. Text inside the shape is to use the minor font defined by the theme.

end example]

Parent Elements

cxnSp (§; pic (§; sp (§

Child Elements


effectRef (Effect Reference)


fillRef (Fill Reference)


fontRef (Font Reference)


lnRef (Line Reference)


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

© ISO/IEC29500: 2008.

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