Description
This class is used to store the styles of a document. It is essentially a collection of named styles.
C#
[DefaultMember("Item")]
public sealed class Styles
vb.net
<DefaultMember("Item")> _
Public NotInheritable Class Styles
Remarks
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
C#
WordApplication app = new WordApplication();
Document doc = app.Open(@"C:\sample.doc");
Styles styls = doc.Styles;
vb.net
Dim app As New WordApplication()
Dim doc As Document = app.Open("C:\sample.doc")
Dim styls As Styles = doc.Styles
Indexers
Name |
Description |
|---|---|
| Returns a NamedStyle object that represents the named style that has the specified ID. | |
| Returns a NamedStyle object that represents the named style that has the specified built in name. | |
| Returns a NamedStyle object that represents the named style that has the specified string version of its name. |
Methods
Name |
Description |
|---|---|
Returns an int that represents the number of styles in this collection. |
