Поделиться через


TextAlignment Class

Defines the TextAlignment Class.When the object is serialized out as xml, its qualified name is w:textAlignment.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.TextAlignment

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

Syntax

'Declaration
Public Class TextAlignment _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As TextAlignment
public class TextAlignment : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 1st Edition]

17.3.1.39 textAlignment (Vertical Character Alignment on Line)

This element specifies the vertical alignment of all text on each line displayed within a paragraph. If the line height (before any added spacing) is larger than one or more characters on the line, all characters are aligned to each other as specified by this element.

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then the vertical alignment of all characters on the line shall be automatically determined by the consumer.

[Example: Consider a paragraph of text of different font sizes, as follows:

DocumentFormat.OpenXml.Wordprocessing.TextAlignmen

If the text on this paragraph must be aligned based on the top point of the maximum character height, that requirement would be specified as follows in the WordprocessingML:

<w:pPr>
  <w:textAlignment w:val="top" />
</w:pPr>

The resulting text would be top aligned, as follows:

DocumentFormat.OpenXml.Wordprocessing.TextAlignmen

The characters are all aligned to the maximum character extent on the line. end example]

Parent Elements

pPr (§17.3.1.26); pPr (§17.3.1.25); pPr (§17.7.5.2); pPr (§17.7.6.1); pPr (§17.9.23); pPr (§17.7.8.2)

Attributes

Description

val (Vertical Character Alignment Position)

Specifies the style of vertical alignment which shall be used to align the characters on each line in the current paragraph.

[Example: Consider a paragraph of text of different font sizes which must be aligned based on the baseline point of each character in each line. This requirement would be specified as follows in the WordprocessingML:

<w:pPr>
  <w:textAlignment w:val="baseLine" />
</w:pPr>

The resulting text would be aligned to the baseline for each character on the line. end example]

The possible values for this attribute are defined by the ST_TextAlignment simple type (§17.18.91).

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

TextAlignment Members

DocumentFormat.OpenXml.Wordprocessing Namespace