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


LineNumberType Class

Line Numbering Settings.When the object is serialized out as xml, its qualified name is w:lnNumType.

Inheritance Hierarchy

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

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

Syntax

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

Remarks

[ISO/IEC 29500-1 1st Edition]

17.6.8 lnNumType (Line Numbering Settings)

This element specifies the settings for line numbering to be displayed before each column of text in this section in the document.

[Example: Consider the line numbering used on each page of this document, which specifies: line numbering for each line, restarting at one at the top of each new page. This line-numbering scheme would be defined using the following WordprocessingML:

<w:sectPr>
…
<w:lnNumType w:countBy="1" />
</w:sectPr>

This content specifies that line numbers shall be included on each line, restart on each page (the default), be placed automatically based on the text (the default), and shall restart at one (the default). end example]

Parent Elements

sectPr (§17.6.17); sectPr (§17.6.18); sectPr (§17.6.19)

Attributes

Description

countBy (Line Number Increments to Display)

Specifies the line number increments to be displayed in the current document.

Although each line has an associated line number, only lines which are an even multiple of this value shall be displayed.

[Example: Consider a document in which only every fifth line must have a line number. The resulting WordprocessingML for this setting would be:

<w:lnNumType … w:countBy="5"/>

This setting ensures that only lines whose number is a multiple of  (e.g. 5, 10, and 15) has a line number displayed. end example]

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

distance (Distance Between Text and Line Numbering)

Specifies the distance between the text margin and the edge of any line numbers appearing in that section.

[Example: Consider a document in which the line numbering must appear one-half inch from the text margin. The WordprocessingML for this setting is:

<w:lnNumType … w:distance="720"/>

The distance attribute specifies that there must be a 720 twip spacing between the text margin and the line numbering. end example]

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

restart (Line Numbering Restart Setting)

Specifies when the line numbering in this section shall be reset to the line number specified by the start attribute's value.

The line numbering increments for each line (even if it is not displayed) until it reaches the restart point specified by this element.

[Example: Consider the line numbering used on each page of this document, which specifies that line numbering must restart at the top of each new page. This line numbering setting would be defined using the following WordprocessingML:

<w:sectPr>
…
<w:lnNumType w:restart="newPage" … />
</w:sectPr>

The value of newPage specifies that the line numbers must restart at the top of each page to the value specified by the start attribute. In this case, newPage is the default, so this value could have been omitted entirely. end example]

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

start (Line Numbering Starting Value)

Specifies the starting value used for the first line whenever the line numbering is restarted by use of the restart attribute.

[Example: Consider a document in which line numbering must appear on every fifth line, but the first line must be treated as line number . This setting would require the following WordprocessingML syntax:

<w:lnNumType w:start="3" w:countBy="5"/>

The start attribute specifies that line numbers must be counted starting from the number 3. end example]

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

[Note: The W3C XML Schema definition of this element’s content model (CT_LineNumber) 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

LineNumberType Members

DocumentFormat.OpenXml.Wordprocessing Namespace