DocumentBase.StyleSheets Property

Definition

Gets a StyleSheets object that represents the Web style sheets attached to the document.

public Microsoft.Office.Interop.Word.StyleSheets StyleSheets { get; }

Property Value

A StyleSheets object that represents the Web style sheets attached to the document.

Examples

The following code example adds a style sheet to the document. The code example assumes that a style sheet called WebSite.css exists at the root of the C directory. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentStyleSheets()
{
    this.StyleSheets.Add("c:\\WebSite.css", Microsoft.Office.
        Interop.Word.WdStyleSheetLinkType.wdStyleSheetLinkTypeLinked, 
        "myStyleSheet", Word.WdStyleSheetPrecedence.
        wdStyleSheetPrecedenceHighest);

}

Applies to

Ürün Sürümler
Visual Studio Tools for Office 2017, 2019, 2022