DocGrid.CharacterSpace Property

Document Grid Character Pitch.Represents the attribte in schema: w:charSpace

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


<SchemaAttrAttribute(, "charSpace")> _
Public Property CharacterSpace As Int32Value
Dim instance As DocGrid
Dim value As Int32Value

value = instance.CharacterSpace

instance.CharacterSpace = value
[SchemaAttrAttribute(, "charSpace")]
public Int32Value CharacterSpace { get; set; }

Property Value

Type: DocumentFormat.OpenXml.Int32Value
Returns Int32Value.


The following information from the ECMA International Standard ECMA-376 can be useful when working with this class.

Specifies the number of characters to be allowed on the document grid for each line in this section.

This attribute's value shall be specified by multiplying the difference between the desired character pitch and the character pitch for that character in the font size of the Normal font by 4096.

This value shall then be used to add the character pitch for the specified point size to each character in the section This results in text in the Normal style having a specific number of characters per line.

Consider a section with a Normal font size of 11 points on which a 21-point pitch document grid has been defined.. The resulting WordprocessingML would be defined as follows:

<w:docGrid w:charSpace="40960" …/>

The charSpace attribute specifies a value of 40960, which means that the delta between the character pitch of each character in the grid and the Normal font is 10 points, resulting in a character pitch of 11 + 10 = 21 points for all characters in this section.

Individual runs of text can override the line pitch information specified for the document grid by specifying that the run text shall not snap to the document grid via the snapToGrid element.

The possible values for this attribute are defined by the ST_DecimalNumber simple type.

See Also


DocGrid Class

DocGrid Members

DocumentFormat.OpenXml.Wordprocessing Namespace