styleSheets Property

       

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

expression.styleSheets

expression   Required. An expression that returns a DispFPHTMLDocument object.

Remarks

Imported style sheets are contained within a <STYLE> element and are available through the imports collection.

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