Message-ID: <1041744928.7937.1711626885754.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7936_228137089.1711626885754" ------=_Part_7936_228137089.1711626885754 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html NamedStyle

NamedStyle

Description

=20

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

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

Remarks

=20

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 insta= nce of this class from the Document.Styles collection. You can apply a style to differen= t sections and elements within your document. You cannot, however, modify a= named style using WordWriter.

=20

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

=20

Examples

=20
C#
=20

          NamedStyle heading1Style =3D doc.Styles[NamedStyle.BuiltIn.Headin=
g1];
          Paragraph p =3D doc.InsertParagraphAfter(heading1Style);
        
=20
=20
vb.net
=20

          Dim heading1Style As NamedStyle =3D doc.Styles(NamedStyle.BuiltIn=
.Heading1)
          Dim p As Paragraph =3D doc.InsertParagraphAfter(heading1Style)
        
=20
=20

Properties

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

BuiltInStyleName

Returns a NamedStyle.BuiltIn object that represents the culture-independent= name of this style. This is only useful for built-in styles that come with= Word. Any custom styles will return UserDefined.

Font=

Returns a Font object that is a copy of this style's font. Some style types do= not have character formatting. In these cases, this method returns null.=20

Name=

Returns a String representing the n= ame of this NamedStyle.

ParagraphFormatting

Returns a ParagraphFormatting object that is a copy of this style's paragr= aph formatting. Some style types do not have paragraph formatting. In these= cases, this method returns null.

StyleType

Returns a NamedStyle.Type object that represents the type of this style. Word = 2003 supports four style types: Character, Paragraph, Table, and List. Olde= r versions support fewer than this.

TableFormatting

Returns a TableFormatting object that is a copy of this style's table formatti= ng. Some style types do not have table formatting. In these cases, this met= hod returns null.
=20

Nested Classes

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

B= uiltIn

Named styles that are built-in to Word.

Type=

Types of named styles.
------=_Part_7936_228137089.1711626885754--