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 > Styles

The Styles Object


This class is used to store the styles of a document. It is essentially a collection of named styles.

You cannot create styles programmatically. You can only access Named Styles from an existing document. At this time, styles are read-only, but in the future you will be able to modify Named Styles using WordWriter.

The following example demonstrates how to get the styles from a document.



Examples:

[csharp]
WordApplication app = new WordApplication();
 Document doc = app.Open(@"C:\sample.doc");
 Styles styls = doc.Styles;
[vbnet]
Dim app As New WordApplication()
 Dim doc As Document = app.Open("C:\sample.doc")
 Dim styls As Styles = doc.Styles


Styles Properties

Property Type Access Description
Item (overloaded) read

Returns a NamedStyle object that represents the named style that has the specified string version of its name



Styles Methods

ReturnsSignature and Description
int Length ( )

Returns an int that represents the number of styles in this collection



Copyright 2007 © SoftArtisans, Inc. All Rights Reserved.