TextBoxContent class

Office 2013 and later

Rich Text Box Content Container. When the object is serialized out as xml, its qualified name is w:txbxContent.

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

[ChildElementInfoAttribute(typeof(MoveToRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlInsRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlDelRangeStart))]
[ChildElementInfoAttribute(typeof(CustomXmlInsRangeStart))]
[ChildElementInfoAttribute(typeof(RunConflictDeletion), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(AltChunk))]
[ChildElementInfoAttribute(typeof(CustomXmlBlock))]
[ChildElementInfoAttribute(typeof(SdtBlock))]
[ChildElementInfoAttribute(typeof(Paragraph))]
[ChildElementInfoAttribute(typeof(Table))]
[ChildElementInfoAttribute(typeof(ProofError))]
[ChildElementInfoAttribute(typeof(PermStart))]
[ChildElementInfoAttribute(typeof(PermEnd))]
[ChildElementInfoAttribute(typeof(BookmarkStart))]
[ChildElementInfoAttribute(typeof(BookmarkEnd))]
[ChildElementInfoAttribute(typeof(CommentRangeStart))]
[ChildElementInfoAttribute(typeof(CommentRangeEnd))]
[ChildElementInfoAttribute(typeof(MoveFromRangeStart))]
[ChildElementInfoAttribute(typeof(MoveFromRangeEnd))]
[ChildElementInfoAttribute(typeof(MoveToRangeStart))]
[ChildElementInfoAttribute(typeof(CustomXmlDelRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlMoveFromRangeStart))]
[ChildElementInfoAttribute(typeof(CustomXmlMoveFromRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlMoveToRangeStart))]
[ChildElementInfoAttribute(typeof(CustomXmlMoveToRangeEnd))]
[ChildElementInfoAttribute(typeof(CustomXmlConflictInsertionRangeStart), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(CustomXmlConflictInsertionRangeEnd), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(CustomXmlConflictDeletionRangeStart), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(CustomXmlConflictDeletionRangeEnd), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
[ChildElementInfoAttribute(typeof(InsertedRun))]
[ChildElementInfoAttribute(typeof(DeletedRun))]
[ChildElementInfoAttribute(typeof(MoveFromRun))]
[ChildElementInfoAttribute(typeof(MoveToRun))]
[ChildElementInfoAttribute(typeof(ContentPart), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(RunConflictInsertion), FileFormatVersions.None|FileFormatVersions.Office2010|FileFormatVersions.Office2013)]
public class TextBoxContent : OpenXmlCompositeElement

[ISO/IEC 29500-1 1st Edition]

txbxContent (Rich Text Box Content Container)

This element specifies that its contents shall be any rich WordprocessingML content, and that this content is the rich contents of a drawing object defined using the Vector Markup Language (VML) syntax (§14.1).

If this element contains within any of its contents any of the following content, then the document shall be considered non-conformant:

  • References to other WordprocessingML document stories (comments, footnotes, endnotes)

  • Additional txbxContent elements (as part of nested VML objects)

[Example: Consider a WordprocessingML document consisting of a single VML shape element (§14.1.2.19) (in this case, a star) that contains within it some WordprocessingML content:

That drawing object now contains a text box, and so uses the syntax for that text box:

<v:shape id="_x0000_s1026" type="#_x0000_t12" style="…">
  <v:textbox>
    <w:txbxContent>
      <w:p>
        <w:pPr>
          <w:jc w:val="center"/>
        </w:pPr>
        <w:r>
          <w:t>Rich WordprocessingML content!</w:t>
        </w:r>
      </w:p>
    </w:txbxContent>
  </v:textbox>
</v:shape>

The txbxContent element is the container for the WordprocessingML contained within the text box inside that shape - once inside this element any content (subject to the restrictions defined above) can be used. end example]

Parent Elements

textbox (§14.1.2.22)

Child Elements

Subclause

altChunk (Anchor for Imported External Content)

Part 1, §17.17.2.1

bookmarkEnd (Bookmark End)

Part 1, §17.13.6.1

bookmarkStart (Bookmark Start)

Part 1, §17.13.6.2

commentRangeEnd (Comment Anchor Range End)

Part 1, §17.13.4.3

commentRangeStart (Comment Anchor Range Start)

Part 1, §17.13.4.4

customXml (Block-Level Custom XML Element)

Part 1, §17.5.1.6

customXmlDelRangeEnd (Custom XML Markup Deletion End)

Part 1, §17.13.5.4

customXmlDelRangeStart (Custom XML Markup Deletion Start)

Part 1, §17.13.5.5

customXmlInsRangeEnd (Custom XML Markup Insertion End)

Part 1, §17.13.5.6

customXmlInsRangeStart (Custom XML Markup Insertion Start)

Part 1, §17.13.5.7

customXmlMoveFromRangeEnd (Custom XML Markup Move Source End)

Part 1, §17.13.5.8

customXmlMoveFromRangeStart (Custom XML Markup Move Source Start)

Part 1, §17.13.5.9

customXmlMoveToRangeEnd (Custom XML Markup Move Destination Location End)

Part 1, §17.13.5.10

customXmlMoveToRangeStart (Custom XML Markup Move Destination Location Start)

Part 1, §17.13.5.11

del (Deleted Run Content)

Part 1, §17.13.5.14

ins (Inserted Run Content)

Part 1, §17.13.5.18

moveFrom (Move Source Run Content)

Part 1, §17.13.5.22

moveFromRangeEnd (Move Source Location Container - End)

Part 1, §17.13.5.23

moveFromRangeStart (Move Source Location Container - Start)

Part 1, §17.13.5.24

moveTo (Move Destination Run Content)

Part 1, §17.13.5.25

moveToRangeEnd (Move Destination Location Container - End)

Part 1, §17.13.5.27

moveToRangeStart (Move Destination Location Container - Start)

Part 1, §17.13.5.28

oMath (Office Math)

Part 1, §22.1.2.77

oMathPara (Office Math Paragraph)

Part 1, §22.1.2.78

p (Paragraph)

Part 1, §17.3.1.22

permEnd (Range Permission End)

Part 1, §17.13.7.1

permStart (Range Permission Start)

Part 1, §17.13.7.2

proofErr (Proofing Error Anchor)

Part 1, §17.13.8.1

sdt (Block-Level Structured Document Tag)

Part 1, §17.5.2.29

tbl (Table)

Part 1, §17.4.38

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