Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.22 KB

Word.StyleSheets.md

File metadata and controls

42 lines (29 loc) · 1.22 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
StyleSheets object (Word)
vbawd10.chm3198
vbawd10.chm3198
Word.StyleSheets
4b3da354-38a6-5758-3080-82a940b668c9
06/08/2017
medium

StyleSheets object (Word)

A collection of StyleSheet objects that represents the cascading style sheets attached to a document. The StyleSheets collection includes all cascading style sheets displayed in the Linked CSS Style Sheets dialog box.

Remarks

Use the StyleSheets property to return the StyleSheets collection. Use the Add method to add a style sheet to the StyleSheets collection. The following example adds three cascading style sheets to the active document and sets the third as the highest in precedence.

Sub AddCSS() 
 With ActiveDocument.StyleSheets 
 .Add FileName:="Web.css", Title:="Web Styles" 
 .Add FileName:="New.css", Linktype:=wdStyleSheetLinkTypeImported, _ 
 Title:="New Styles" 
 .Add FileName:="Defs.css", Title:="Definitions", _ 
 Precedence:=wdStyleSheetPrecedenceHighest 
 End With 
End Sub

See also

Word Object Model Reference

[!includeSupport and feedback]