Styles Interface 

A collection of Style objects that represent both the built-in and user-defined styles in a document.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Public Class tylesImplementation
    Implements Styles
End Class
Dim tylesImplementation1 As New tylesImplementation()

Syntax

Public Interface Styles
    Inherits IEnumerable
public interface Styles : IEnumerable
public interface class Styles : public IEnumerable
public interface Styles implements IEnumerable
public interface Styles implements IEnumerable

Remarks

Use the Styles property to return the Styles collection.

Use the Add method to create a new user-defined style and add it to the Styles collection.

Use Styles(index), where index is the style name, a WdBuiltinStyle constant or index number, to return a single Style object. You must exactly match the spelling and spacing of the style name, but not necessarily its capitalization.

The style index number represents the position of the style in the alphabetically sorted list of style names.

The Styles object isn't available from the Template object. However, you can use the OpenAsDocument method to open a template as a document so that you can modify styles in the template.

Use the OrganizerCopy method to copy styles between documents and templates. Use the UpdateStyles method to update the styles in the active document to match the style definitions in the attached template.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Microsoft.Office.Interop.Word Namespace

Other Resources

Styles Members