Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

The NamedStyle class represents a named style, such as "Normal", "Heading 1", etc., that is embedded in a Word document.

Signature
C#
C#
<p> public sealed class NamedStyle
NamedStyle</p>
Signature
vb.net
vb.net
Public<p>Public NotInheritable Class NamedStyle
NamedStyle</p>
Remarks

You cannot create a new named style programmatically. You can only work with Named Styles that are in an existing document. You can obtain an instance of this class from the Document.Styles collection. You can apply a style to different sections and elements within your document. You cannot, however, modify a named style using WordWriter.

The following sample retrieves a copy of the Heading 1 style and applies it to a new paragraph.

...

Name

Description

BuiltInStyleName

Excerpt Include
WW8:NamedStyle.BuiltInStyleNameWW8:
NamedStyle.BuiltInStyleName
nopaneltrue

Font

Excerpt Include
WW8:NamedStyle.FontWW8:
NamedStyle.Font
nopaneltrue

Name

Excerpt Include
WW8:NamedStyle.NameWW8:
NamedStyle.Name
nopaneltrue

ParagraphFormatting

Excerpt Include
WW8:NamedStyle.ParagraphFormattingWW8:
NamedStyle.ParagraphFormatting
nopaneltrue

StyleType

Excerpt Include
WW8:NamedStyle.StyleTypeWW8:
NamedStyle.StyleType
nopaneltrue

TableFormatting

Excerpt Include
WW8:NamedStyle.TableFormattingWW8:
NamedStyle.TableFormatting
nopaneltrue

...

Name

Description

BuiltIn

Excerpt Include
WW8:NamedStyle.BuiltInWW8:
NamedStyle.BuiltIn
nopaneltrue

Type

Excerpt Include
WW8:NamedStyle.TypeWW8:
NamedStyle.Type
nopaneltrue