Udostępnij za pośrednictwem


Document.StyleSheets Property (2007 System)

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

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property StyleSheets As StyleSheets
'Usage
Dim instance As Document 
Dim value As StyleSheets 

value = instance.StyleSheets
[BrowsableAttribute(false)]
public StyleSheets StyleSheets { get; }
[BrowsableAttribute(false)]
public:
property StyleSheets^ StyleSheets {
    StyleSheets^ get ();
}
public function get StyleSheets () : StyleSheets

Property Value

Type: StyleSheets
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.

This example is for a document-level customization.

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

}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace