[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.Style

Class Style

Namespace
GrapeCity.Documents.Word
Assembly
GcDocs.Word.dll

Represents a built-in or user-defined style.

public class Style
Inheritance
object
Style
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Properties

Aliases

Gets the collection of alternative names for the style. These names can be used in an application's user interface as desired.

public AliasCollection Aliases { get; }

Property Value

AliasCollection

AutomaticallyUpdate

Gets or sets whether an application shall automatically modify this style when the contents of an entire paragraph in the document with this style applied are modified, ensuring that although only a single instance of text with this style was modified, that change is stored on the style and therefore propagated to all locations where the style is in use.

public bool AutomaticallyUpdate { get; set; }

Property Value

bool

BaseStyle

Gets or sets an existing style on which the formatting of this style is based.

public Style BaseStyle { get; set; }

Property Value

Style

BuiltIn

Gets a value indicating whether this style is one of the built-in styles in Microsoft Word.

public bool BuiltIn { get; }

Property Value

bool

BuiltInId

Gets the locale independent style identifier for a built-in style.

public BuiltInStyleId BuiltInId { get; }

Property Value

BuiltInStyleId

Document

Gets the parent document.

public DocumentBase Document { get; }

Property Value

DocumentBase

Font

Gets the character formatting of this style.

public Font Font { get; }

Property Value

Font

InUse

Get a value indicating whether the built-in style has been modified or applied in the document or it is a new style that has been created in the document.

public bool InUse { get; }

Property Value

bool

Linked

Gets a value indicating whether a style is a linked style that can be used for both paragraph and character formatting.

public bool Linked { get; }

Property Value

bool

LinkStyle

Gets the style linked to the current style.

Styles can be paired to comprise a linked style.

A linked style is a grouping of a paragraph style and a character style that is used in a user interface to allow the same set of formatting properties to be applied.

public Style LinkStyle { get; }

Property Value

Style

ListFormat

Get a list formatting for the paragraph style.

This property is only valid for paragraph styles. For other style types this property returns null.

public ListFormat ListFormat { get; }

Property Value

ListFormat

ListTemplate

Gets the ListTemplate that defines list formatting for the list style.

This property is only valid for list styles. For other style types this property returns null.

public ListTemplate ListTemplate { get; }

Property Value

ListTemplate

Locked

Gets or sets a value indicating whether an application shall prevent the use of this style when this document is loaded and/or modified.

If true, this style can be used to format existing content (i.e. any content that references this style shall have its properties as normal), but new instances of the style shall be prevented from being applied via all mechanisms associated with that application.

public bool Locked { get; set; }

Property Value

bool

Name

Gets or sets the name of the style.

public string Name { get; set; }

Property Value

string

NextParagraphStyle

Gets or sets the style to be applied automatically to a new paragraph inserted after a paragraph formatted with the specified style.

public Style NextParagraphStyle { get; set; }

Property Value

Style

ParagraphFormat

Gets the paragraph formatting of the style.

public ParagraphFormat ParagraphFormat { get; }

Property Value

ParagraphFormat

Remarks

For character and list styles this property returns null.

Priority

A number that can be used to sort the set of style definitions in a user interface.

public int Priority { get; set; }

Property Value

int

QuickStyle

Gets or sets a value indicating whether this style shall be treated as a primary style when this document is loaded by an application. If true then this style has been designated as being particularly important for the current document, and this information can be used by an application in any means desired.

public bool QuickStyle { get; set; }

Property Value

bool

RevisionId

Gets or sets unique identifiers used to track style editing session.

A producer can choose to increment the revision save ID value to indicate subsequent editing (editing between save actions) to indicate the order of the saves performed.

public int RevisionId { get; set; }

Property Value

int

Table

Gets a TableStyle object representing properties that can be applied to a table using a table style.

public TableStyle Table { get; }

Property Value

TableStyle

Type

Gets the style type.

public StyleType Type { get; }

Property Value

StyleType

UnhideWhenUsed

Gets or sets a value indicating whether Visibility shall be reset when this style is used by the content of the document.

If true, an application shall ensure that even if the Visibility is SemiHidden that this property should be considered as Visible if the style is referenced by any content in the document.

public bool UnhideWhenUsed { get; set; }

Property Value

bool

Visibility

Gets or sets the style visibility in application user interface.

public StyleVisibility Visibility { get; set; }

Property Value

StyleVisibility

WordName

Gets the Word style English name.

public string WordName { get; }

Property Value

string

Methods

Delete()

Deletes the style from the document.

public void Delete()

Remarks

Style removal has following effects on the document model:

  • All references to the style are removed from corresponding paragraphs, runs and tables.
  • If a base style is removed, its formatting is moved to child styles.
  • If the style to be deleted has a linked style, then both styles are deleted.