DocumentBase.StyleSheets Property
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.
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);
}
Private Sub DocumentStyleSheets()
Me.StyleSheets.Add("c:\WebSite.css", Microsoft.Office.Interop.Word. _
WdStyleSheetLinkType.wdStyleSheetLinkTypeLinked, "myStyleSheet", _
Word.WdStyleSheetPrecedence.wdStyleSheetPrecedenceHighest)
End Sub