Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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</p>
Signature
vb.net
vb.net

<p>Public NotInheritable Class NamedStyle</p>

...

Example
Code Block
csharp
csharp
titleC#
		  //Set Named Style when element is created
          NamedStyle heading1Style = doc.Styles[NamedStyle.BuiltIn.Heading1];
          Paragraph p = doc.InsertParagraphAfter(heading1Style);
 
		  //Set style of existing element
          p.Style = oDocument.Styles[NamedStyle.BuiltIn.Heading1];
Code Block
vb.net
vb.net
titlevb.net
          //Set named style when element is created
          Dim heading1Style As NamedStyle = doc.Styles(NamedStyle.BuiltIn.Heading1)
          Dim p As Paragraph = doc.InsertParagraphAfter(heading1Style)
 
          //Set style of existing element
          p.Style = oDocument.Styles(NamedStyle.BuilIn.Heading1)
        

Properties

Name

Description

BuiltInStyleName

Excerpt Include
NamedStyle.BuiltInStyleName
NamedStyle.BuiltInStyleName
nopaneltrue

Font

Excerpt Include
NamedStyle.Font
NamedStyle.Font
nopaneltrue

Name

Excerpt Include
NamedStyle.Name
NamedStyle.Name
nopaneltrue

ParagraphFormatting

Excerpt Include
NamedStyle.ParagraphFormatting
NamedStyle.ParagraphFormatting
nopaneltrue

StyleType

Excerpt Include
NamedStyle.StyleType
NamedStyle.StyleType
nopaneltrue

TableFormatting

Excerpt Include
NamedStyle.TableFormatting
NamedStyle.TableFormatting
nopaneltrue

Classes

Name

Description

BuiltIn

Excerpt Include
NamedStyle.BuiltIn
NamedStyle.BuiltIn
nopaneltrue

Type

Excerpt Include
NamedStyle.Type
NamedStyle.Type
nopaneltrue