Export (0) Print
Expand All

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)

[GuidAttribute("0002092D-0000-0000-C000-000000000046")]
public interface Styles : IEnumerable

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.

Community Additions

ADD
Show:
© 2014 Microsoft