Share via


styleSheets Property

Returns an FPHTMLStyleSheetsCollection collection that represents the collection of all style sheets in a document.

expression.styleSheets

*expression   * Required. An expression that returns one of the objects in the Applies to list.

Remarks

Use the imports property to access imported style sheets, specified by using a STYLE element with an **@Import** statement.

Example

The following example creates a reference to the current document's style sheets collection and displays the title (if it exists) for each stylesheet in the collection.

Sub ReturnStyleSheets()
'Returns a collection of a style sheets in the document

    Dim objApp As FrontPage.Application
    Dim objStyleSheets As FPHTMLStyleSheetsCollection
    Dim objStyleSheet As FPHTMLStyleSheet

    Set objApp = FrontPage.Application
    Set objStyleSheets = objApp.ActiveDocument.styleSheets
    'For each style sheet in the document
    For Each objStyleSheet In objStyleSheets
        'if it has a title, display it
        If objStyle.Title <> "" Then
            MsgBox objStyleSheet.Title
        End If
    Next objStyleSheet

End Sub

Applies to | FPHTMLDocument Object | IHTMLDocument2 Object