Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

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

Signature
C#C#
Wiki Markup
{description}
{excerpt}This class is used to store the styles of a document. It is essentially a collection of named styles.{excerpt}
{signature:C#}
[DefaultMember("Item")]
 public sealed class Styles
Signature
{signature}{signature:vb.net
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.

{signature}
{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.

{remarks}
{example}{code:csharp|title=C#}

          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          Styles styls = doc.Styles;
        
{code}
{code:vb.net
|title=vb.net
}

          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim styls As Styles = doc.Styles
        
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle
Indexers

...

Name

...

Description

{code}

{example}
{indexers}
||Name||Description||
|[Item(Int32)

...

|Styles.Item(Int32)

...

]|{excerpt-include:Styles.Item(Int32)

...

|nopanel

...

=true}|
|[Item(NamedStyle.BuiltIn)

...

|Styles.Item(NamedStyle.BuiltIn)

...

]|{excerpt-include:Styles.Item(NamedStyle.BuiltIn)

...

|nopanel

...

=true}|
|[Item(String)

...

|Styles.Item(String)

...

]|{excerpt-include:Styles.Item(String)

...

|nopanel

...

Methods

...

Name

...

Description

...

Length()

...

=true}|
{methods}
||Name||Description||
|[Length()|Styles.Length()

...

]|{excerpt-include:Styles.Length()

...

|nopanel

...

=true}|