DocumentBase.Styles Property


Gets a Styles collection for the document.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

public Styles Styles { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Styles

A Styles collection for the document.

The following code example creates a new style named "myStyle" and sets its font size to 26 points. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentStyles()
    this.Styles.Add("myStyle", Word.WdStyleType.wdStyleTypeParagraph);
    this.Styles["myStyle"].Font.Size = 26;
Return to top