Compartilhar via


StyleSheet.Title Property

Word Developer Reference

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.

Visual Basic for Applications
  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.

Visual Basic for Applications
  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 &amp; vbTab &amp; styCSS.<strong class="bterm">Title</strong>
        .InsertParagraphAfter
    Next styCSS
    .ConvertToTable
End With

End Sub

See Also