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

[DefaultMember("Item")]
 public sealed class Styles
<DefaultMember("Item")> _
	Public NotInheritable Class 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.


          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          Styles styls = doc.Styles;
        

          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim styls As Styles = doc.Styles
        

Name

Description

Item(Int32)

Item(NamedStyle.BuiltIn)

Item(String)

Name

Description

Length()