a:txBody (Text Body) is the fundamental text container in DrawingML. It is defined in ECMA-376 Part 1 §20.1.2.6 and encapsulates all text content, formatting, and behavior for shapes, text boxes, placeholders, and other DrawingML objects.
Purpose and Scope
a:txBody serves three key functions:
Text Container — Holds one or more paragraphs (a:p) that represent logical text units within a shape.
Body Configuration — Via a:bodyPr, defines how text is rendered (wrapping, margins, rotation, anchoring, autofit).
List Style Definition — Via optional a:lstStyle, provides bullet/numbering formats and default run/paragraph properties for the entire text body.
Content Hierarchy
a:txBody
├─ a:bodyPr (required, 1) — Text rendering configuration
├─ a:lstStyle (optional, 0–1) — Bullet/list styles and defaults
└─ a:p (required, 1+) — Paragraphs with text content
Integration with Shapes
a:txBody appears in:
Text Shapes (a:txSp) — Text is the primary content.
Regular Shapes (a:sp) — Text is optional secondary content.
Connection Shapes (a:cxnSp) — Text labels along connectors.
Placeholders (in presentations) — Title, body, subtitle, note placeholders.
The a:txBody element has no attributes; all configuration is via child elements.
Child Elements
Element
Occurrence
Purpose
a:bodyPr
1 (required)
Controls text rendering: margins, wrapping, rotation, autofit, anchoring.
a:lstStyle
0–1 (optional)
Defines default bullet/numbering formats and style defaults for all levels.
a:p
1+ (required)
Paragraph elements containing actual text content and formatting.
a:bodyPr Child Elements
The a:bodyPr element can contain:
Element
Occurrence
Purpose
a:spAutoFit
0–1
Autofit: Resize shape to fit text (no wrapping).
a:noAutofit
0–1
No autofit: Overflow text is clipped or hidden.
a:normAutofit
0–1
Normal autofit: Word-wrap text; don’t resize shape.
a:shrinkTxtToFit
0–1
Shrink to fit: Reduce font size until text fits.
a:prstTxWarp
0–1
Preset text warp (curved, wavy, etc.).
a:scene3d
0–1
3D scene properties (extrusion, bevel).
a:extLst
0–1
Extension list.
a:lstStyle Child Elements
The a:lstStyle element contains:
Element
Occurrence
Purpose
a:defPPr
0–1
Default paragraph properties for all levels.
a:lvl1pPr–a:lvl9pPr
0–1 each
Paragraph properties for levels 1–9.
a:defRPr
0–1
Default run properties for all levels.
a:extLst
0–1
Extension list.
Examples
Minimal Text Body (Single Paragraph)
<a:txBody>
<a:bodyPr/>
<a:p>
<a:r>
<a:t>Simple text content</a:t>
</a:r>
</a:p>
</a:txBody>
var textBody = new TextBody();
textBody.Append(new BodyProperties());
var para = new Paragraph(
new Run(new Text("Simple text content")));
textBody.Append(para);
Text Body with Wrapping and Margins
<a:txBody>
<a:bodyPr wrap="square" lIns="91440" tIns="91440" rIns="91440" bIns="91440" anchor="ctr"/>
<a:p>
<a:pPr algn="ctr"/>
<a:r>
<a:rPr lang="en-US" sz="2400">
<a:latin typeface="Calibri"/>
</a:rPr>
<a:t>Centered text with margins, wrapped to shape width.</a:t>
</a:r>
</a:p>
</a:txBody>
var textBody = new TextBody();
var bodyPr = new BodyProperties
{
Wrap = TextWrappingTypeValues.Square,
LeftInset = 91440, // 0.1 inch
TopInset = 91440,
RightInset = 91440,
BottomInset = 91440,
Anchor = TextAnchoringTypeValues.Center
};
textBody.Append(bodyPr);
var para = new Paragraph(
new ParagraphProperties { Alignment = TextAlignmentTypeValues.Center },
new Run(
new RunProperties { Language = "en-US", FontSize = 2400 }
.Append(new LatinFont { Typeface = "Calibri" }),
new Text("Centered text with margins, wrapped to shape width.")));
textBody.Append(para);
var textBody = new TextBody();
textBody.Append(new BodyProperties { Wrap = TextWrappingTypeValues.Square });
textBody.Append(new ListStyle());
// Level 0 bullet
var p1 = new Paragraph(
new ParagraphProperties(
new BulletCharacter { Char = "•" },
new BulletFont { Typeface = "Arial" }
) { Level = 0 },
new Run(
new RunProperties { Language = "en-US", FontSize = 2400 }
.Append(new LatinFont { Typeface = "Calibri" }),
new Text("First level bullet point")));
textBody.Append(p1);
// Level 1 bullet
var p2 = new Paragraph(
new ParagraphProperties(
new BulletCharacter { Char = "◦" },
new BulletFont { Typeface = "Arial" }
) { Level = 1 },
new Run(
new RunProperties { Language = "en-US", FontSize = 2400 }
.Append(new LatinFont { Typeface = "Calibri" }),
new Text("Second level sub-bullet")));
textBody.Append(p2);
// Back to level 0
var p3 = new Paragraph(
new ParagraphProperties(
new BulletCharacter { Char = "•" },
new BulletFont { Typeface = "Arial" }
) { Level = 0 },
new Run(
new RunProperties { Language = "en-US", FontSize = 2400 }
.Append(new LatinFont { Typeface = "Calibri" }),
new Text("Back to first level")));
textBody.Append(p3);
Text Body with Autofit (No Wrapping)
<a:txBody>
<a:bodyPr wrap="none">
<a:spAutoFit/>
</a:bodyPr>
<a:p>
<a:pPr algn="l"/>
<a:r>
<a:rPr lang="en-US" sz="2400">
<a:latin typeface="Calibri"/>
</a:rPr>
<a:t>Text will resize the shape to fit; no wrapping.</a:t>
</a:r>
</a:p>
</a:txBody>
var textBody = new TextBody();
var bodyPr = new BodyProperties { Wrap = TextWrappingTypeValues.None };
bodyPr.Append(new ShapeAutoFit());
textBody.Append(bodyPr);
var para = new Paragraph(
new ParagraphProperties { Alignment = TextAlignmentTypeValues.Left },
new Run(
new RunProperties { Language = "en-US", FontSize = 2400 }
.Append(new LatinFont { Typeface = "Calibri" }),
new Text("Text will resize the shape to fit; no wrapping.")));
textBody.Append(para);
a:sp (shape): General shape that may contain text (rectangles, circles, connectors with labels).
a:cxnSp (connection shape): Connector line that can have text along or beside it.
Children (required sequence):
a:bodyPr (body properties): Defines text anchor, wrapping, auto-fit, rotation, margins. Essential for text layout.
a:lstStyle (list style, optional): Reusable bullet/numbering styles and text formatting defaults.
a:p (paragraphs, 1+): At least one paragraph must exist. Contains actual text runs and formatting.
General Notes
Required Child: a:bodyPr and at least one a:p are required; a:lstStyle is optional.
Single Text Container: Each shape, picture, or connector has at most one a:txBody per object type. Text cannot span multiple shapes.
Body Properties Essential: The a:bodyPr child element controls text anchor point, wrapping behavior, auto-fit settings, rotation, and margins. Critical for layout.
List Style Optional: a:lstStyle defines reusable bullet/numbering styles and text formatting for the entire text body. If omitted, uses theme defaults.
Inheritance Chain: Formatting precedence is run properties → paragraph properties → a:lstStyle defaults → master/theme defaults.
Autofit Behavior: Only one autofit mode (a:spAutoFit, a:normAutofit, a:noAutofit, or a:shrinkTxtToFit) is active at a time. Most applications default to a:normAutofit if none is specified.
Rotation Units: Rotation is in 60,000ths of a degree (5400000 = 90°, 2700000 = 270°, etc.).
Right-to-Left: Set rtlCol="true" in a:bodyPr for RTL text direction (Arabic, Hebrew).
Performance: Large text bodies with many paragraphs increase file size and parsing time; consolidate where possible.
Compatibility: Text body structure is consistent across PresentationML (slides), DrawingML (shapes), and SpreadsheetML (cell text), ensuring uniform text handling.
Privacy Notice
This site stores your theme preference and this acknowledgement in localStorage — no cookies, no tracking. When you use the contact form, your message is sent via Formspree (USA) to reach us.