StyleSheet.Title property (Word)
Returns or sets a String representing the title of a Web style sheet. Read/write.
Syntax
expression.Title
expression Required. A variable that represents a 'StyleSheet' object.
Example
This example assigns titles to the first three Web style sheets attached to the active document. This example assumes that there are three style sheets attached to the active document.
Sub AssignCSSTitle()
ActiveDocument.StyleSheets.Item(1).Title = "New Look Stylesheet"
ActiveDocument.StyleSheets.Item(2).Title = "Standard Web Stylesheet"
ActiveDocument.StyleSheets.Item(3).Title = "Definitions Stylesheets"
End Sub
This example creates a list of Web style sheets attached to the active document and places the list in a new document. This example assumes there are one or more Web style sheets attached to the active document.
Sub CSSTitles()
Dim docNew As Document
Dim styCSS As StyleSheet
Set docNew = Documents.Add
With docNew.Range(Start:=0, End:=0)
.InsertAfter "CSS Name : Assigned to " & ActiveDocument.Name _
& vbTab & "Title"
.InsertParagraphAfter
For Each styCSS In ActiveDocument.StyleSheets
.InsertAfter styCSS.Name & vbTab & styCSS.Title
.InsertParagraphAfter
Next styCSS
.ConvertToTable
End With
End Sub
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for