Compartir a través de


LinkedStyle Class

Linked Style Reference.When the object is serialized out as xml, its qualified name is w:link.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.String253Type
        DocumentFormat.OpenXml.Wordprocessing.LinkedStyle

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

Syntax

'Declaration
Public Class LinkedStyle _
    Inherits String253Type
'Usage
Dim instance As LinkedStyle
public class LinkedStyle : String253Type

Remarks

[ISO/IEC 29500-1 1st Edition]

17.7.2.6 link (Linked Style Reference)

This element specifies the pairing of styles which comprise a linked style. A linked style is a grouping of a paragraph style and character style which is used in a user interface to allow the same set of formatting properties to be applied:

  • To the contents of one or more entire paragraphs (i.e. as a paragraph style)

  • To the contents of one or more runs within a paragraph (i.e. as a character style)

Each style continues to exist independently in the file format as there is both a paragraph and character style present within the styles element (§17.7.4.18), however these two styles shall be merged into one and applied appropriately based on whether they are applied to run(s) or paragraph(s), by referencing the styleId attribute of the paired linked style via this element's val attribute.

If this element is omitted, then this style is not part of a linked style pairing. If no style in the current document specifies the styleId present in the val attribute, then this element shall be ignored.

If a style with this styleId is present, then it shall be subject to the following restrictions:

  • If the parent style is a table style, then this element shall be ignored.

  • If the parent style is a paragraph style, then the parent style shall be a character style, or this element shall be ignored.

  • If the parent style is a character style, then the parent style shall be a paragraph style, or this element shall be ignored.

  • If the parent style is a numbering style, then this element shall be ignored.

[Example: Consider a linked style defined as follows in a WordprocessingML document:

<w:style w:type="paragraph" w:styleId="TestParagraphStyle">
<w:link w:val="TestCharacterStyle"/>
…
</w:style>
<w:style w:type="character" w:styleId="TestCharacterStyle">
<w:link w:val="TestParagraphStyle"/>
…
</w:style>

This pairing of a paragraph style and a character style are linked via the link element, which is used the reference the styleId of the paragraph style from the character style definition and vice versa. Because this pairing is permitted based on the rules above, the resulting combination must be used as a linked style, which appears as one style in an application, but uses the character and/or paragraph style as appropriate. end example]

Parent Elements

style (§17.7.4.17)

Attributes

Description

val (String Value)

Specifies that its contents contain a string.

The contents of this string are interpreted based on the context of the parent XML element.

[Example: Consider the following WordprocessingML fragment:

<w:pPr>
  <w:pStyle w:val="heading1" /> 
</w:pPr>

The value of the val attribute is the ID of the associated paragraph style's styleId.

However, consider the following fragment:

<w:sdtPr>
  <w:alias w:val="SDT Title Example" />
  …
</w:sdtPr>

In this case, the decimal number in the val attribute is the caption of the parent structured document tag. In each case, the value is interpreted in the context of the parent element. end example]

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

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

LinkedStyle Members

DocumentFormat.OpenXml.Wordprocessing Namespace