Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ShapeAutoFit class
Collapse the table of content
Expand the table of content

ShapeAutoFit class

Shape AutoFit. When the object is serialized out as xml, its qualified name is a:spAutoFit.

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

public class ShapeAutoFit : OpenXmlLeafElement

[ISO/IEC 29500-1 1st Edition]

spAutoFit (Shape AutoFit)

This element specifies that a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text within a shape is scaled in order to contain all the text inside. If this element is omitted, then noAutofit or auto-fit off is implied.

[Example: Consider the situation where a user is building a diagram and needs to have the text for each shape that they are using stay within the bounds of the shape. An easy way this might be done is by using spAutofit. The following DrawingML illustrates how this might be accomplished.

<p:sp>
  <p:txBody>
    <a:bodyPr rtlCol="0" anchor="ctr">
      <a:spAutoFit/>    
                                                                   </a:bodyPr>
    …    <a:p>
      …      <a:t>Diagram Object 1</a:t>
      …    </a:p>
  </p:txBody>
</p:sp
>
<p:sp>
  <p:txBody>
    <a:bodyPr rtlCol="0" anchor="ctr">
      <a:spAutoFit/>    
                                                                   </a:bodyPr>
    …    <a:p>
      …      <a:t>Diagram Object 2</a:t>
      …    </a:p>
  </p:txBody>
</p:sp>

In the above example there are two shapes that have spAutoFit turned on so that when the user types more text within the shape that the shape actually resizes to accommodate the new data. end example]

Parent Elements

bodyPr (§21.1.2.1.1)

[Note: The W3C XML Schema definition of this element’s content model (CT_TextShapeAutofit) 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.
Show:
© 2015 Microsoft