Modifica

Condividi tramite


Styles Interface

Definition

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

public interface class Styles : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("0002092D-0000-0000-C000-000000000046")]
public interface Styles : System.Collections.IEnumerable
type Styles = interface
    interface IEnumerable
Public Interface Styles
Implements IEnumerable
Attributes
Implements

Remarks

Use the Styles property to return the Styles collection.

Use the Add(String, Object) 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(String, String, String, WdOrganizerObject) 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.

Properties

Application

Returns a Application object that represents the Microsoft Word application.

Count

Returns the number of items in the specified collection. Read-only Integer.

Creator

Returns a 32-bit integer that indicates the application in which the specified object was created. Read-only Integer.

Item[Object]

Returns an individual object in a collection.

Parent

Returns an object that represents the parent object of the specified object.

Methods

Add(String, Object)

Returns a Style object that represents a new user-defined style added to the list of styles.

GetEnumerator()

Applies to