Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.8.1
.NET Platform

View Docs for Another
Version or Platform

Programmer's Reference > WordApplication API > NamedStyle

The NamedStyle Object


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

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.



Examples:

[csharp]
NamedStyle heading1Style = doc.Styles[NamedStyle.BuiltIn.Heading1];
Paragraph p = doc.InsertParagraphAfter(heading1Style);
[vbnet]
Dim heading1Style As NamedStyle = doc.Styles(NamedStyle.BuiltIn.Heading1)
Dim p As Paragraph = doc.InsertParagraphAfter(heading1Style);


NamedStyle Enumerations

NameDescription
NamedStyle.BuiltIn

Named styles that are built-in to Word

NamedStyle.Type

Types of named styles



NamedStyle Properties

Property Type Access Description
BuiltInStyleName NamedStyle.BuiltIn read

Returns a NamedStyle.BuiltIn object that represents the culture-independent name of this style

Font Font read

Returns a Font object that is a copy of this style's font

Name String read

Returns a String representing the name of this NamedStyle

ParagraphFormatting ParagraphFormatting read

Returns a ParagraphFormatting object that is a copy of this style's paragraph formatting

StyleType NamedStyle.Type read

Returns a NamedStyle.Type object that represents the type of this style

TableFormatting TableFormatting read

Returns a TableFormatting object that is a copy of this style's table formatting



This object does not have any methods defined.



Copyright 2007 © SoftArtisans, Inc. All Rights Reserved.