Freigeben über


ContextualSpacing-Klasse

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

Vererbungshierarchie

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.OnOffType
        DocumentFormat.OpenXml.Wordprocessing.ContextualSpacing

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

Syntax

'Declaration
Public Class ContextualSpacing _
    Inherits OnOffType
'Usage
Dim instance As ContextualSpacing
public class ContextualSpacing : OnOffType

Hinweise

[ISO/IEC 29500-1 1. Ausgabe]

17.3.1.9 contextualSpacing (Ignore Spacing Above and Below When Using Identical Styles)

This element specifies that any space specified before or after this paragraph, specified using the spacing element (§17.3.1.33), should not be applied when the preceding and following paragraphs are of the same paragraph style, affecting the top and bottom spacing respectively. [Example: This value is typically used for paragraphs in lists, in which any space between subsequent list items, even if inherited from another style, is not desirable. end example]

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 spacing is not ignored. If it is present, then the spacing above or below on this paragraph is subtracted from the spacing which would have been present if contextual spacing was off, never going below zero.

[Example: Consider two paragraphs defined as follows:

<w:p>
  <w:pPr>
    <w:pStyle w:val="TestParagraphStyle" />
    <w:spacing w:after="200"/>
    <w:contextualSpacing/>
  </w:pPr>
  …
</w:p>
<w:p>
  <w:pPr>
    <w:pStyle w:val="TestParagraphStyle" />
    <w:spacing w:before="240"/>
  </w:pPr>
  …
</w:p>

The first paragraph specifies a spacing after of 10 points, and the second paragraph specifies a spacing before of 12 points, therefore according to the rules on the spacing element, the net paragraph spacing should be 12 points. However, since the first paragraph specifies that its spacing should be omitted between paragraphs of the same style, and the two paragraphs use the same TestParagraphStyle, that value is subtracted from the total, therefore the paragraphs are spaced by 2 points. 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)

This element's content model is defined by the common boolean property definition in §17.17.4.

© ISO/IEC29500: 2008. Die oben aufgeführten Textauszüge wurden von Microsoft (und/oder den Microsoft-Vendoren) von Englisch nach Deutsch übersetzt, und im Rahmen von ISO wird keinerlei Verantwortung für diese Übersetzungen übernommen.

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Siehe auch

Referenz

ContextualSpacing-Member

DocumentFormat.OpenXml.Wordprocessing-Namespace