Style Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a single built-in or user-defined style.
public interface class Style
[System.Runtime.InteropServices.Guid("0002092C-0000-0000-C000-000000000046")]
public interface Style
type Style = interface
Public Interface Style
- Attributes
Remarks
The Style object includes style attributes (font, font style, paragraph spacing, and so on) as properties of the Style object. The Style object is a member of the Styles collection. The Styles collection includes all the styles in the specified document.
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.
To apply a style to a range, paragraph, or multiple paragraphs, set the Style property to a user-defined or built-in style name.
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. Use the OpenAsDocument() method to open a template as a document so that you can modify the template styles.
Properties
Application |
Returns a Application object that represents the Microsoft Word application. |
AutomaticallyUpdate |
True if the style is automatically redefined based on the selection. False if Microsoft Word prompts for confirmation before redefining the style based on the selection. Read/write Boolean. |
BaseStyle |
Returns or sets an existing style on which you can base the formatting of another style. Read/write Object. |
Borders |
Returns a Borders collection that represents all the borders for the specified object. |
BuiltIn |
True if the specified object is one of the built-in styles or caption labels in Microsoft Word. Read-only Boolean. |
Creator |
Returns a 32-bit integer that indicates the application in which the specified object was created. Read-only Integer. |
Description |
Returns the description of the specified style. Read-only String. |
Font |
Returns or sets a Font object that represents the character formatting of the specified object. Read/write Font. |
Frame |
Returns a Frame object that represents the frame formatting for the specified style. Read-only. |
Hidden |
Reserved for internal use. |
InUse |
True if the specified style is a built-in style that has been modified or applied in the document or a new style that has been created in the document. Read-only Boolean. |
LanguageID |
Returns or sets the language for the specified object. Read/write. |
LanguageIDFarEast |
Returns or sets an East Asian language for the specified object. |
Linked |
Returns or sets a Boolean that represents whether a style is a linked style that can be used for both paragraph and character formatting. Read-only. |
LinkStyle |
Sets or returns an Object that represents a link between a paragraph and a character style. Read/write. |
ListLevelNumber |
Returns the list level for the specified style. Read-only Integer. |
ListTemplate |
Returns a ListTemplate object that represents the list formatting for the specified Style object. |
Locked |
True if the specified style is locked. |
NameLocal |
Returns the name of a built-in style in the language of the user. Read/write String. |
NextParagraphStyle |
Returns or sets the style to be applied automatically to a new paragraph inserted after a paragraph formatted with the specified style. Read/write Object. |
NoProofing |
True if the spelling and grammar checker ignores text formatted with this style. Read/write Integer. |
NoSpaceBetweenParagraphsOfSameStyle |
True for Microsoft Word to remove spacing between paragraphs that are formatted using the same style. Read/write Boolean. |
ParagraphFormat |
Returns or sets a ParagraphFormat object that represents the paragraph settings for the specified style. Read/write. |
Parent |
Returns an object that represents the parent object of the specified object. |
Priority |
Returns or sets a Integer that represents the priority for sorting styles in the Styles task pane. Read/write. |
QuickStyle |
Returns or sets a Boolean that represents whether the style corresponds to an available quick style. Read/write. |
Shading |
Returns a Shading object that refers to the shading formatting for the specified object. |
Table |
Returns a TableStyle object representing properties that can be applied to a table using a table style. |
Type |
Returns the style type. Read-only Style. |
UnhideWhenUsed |
Set True to clear the Hidden property when this style is used. |
Visibility |
Reserved for internal use. |
Methods
Delete() |
Deletes the specified object. |
LinkToListTemplate(ListTemplate, Object) |
Links the specified style to a list template so that the style's formatting can be applied to lists. |