addImport Method

Microsoft FrontPage Visual Basic

addImport Method

Adds a style sheet to the collection of imported style sheets for a specified style sheet. Returns a Long that represents the index number of the new stylesheet.

expression.addImport(bstrURL, lIndex)

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

bstrURL    Required String. The path and filename for the external cascading style sheet.

lIndex    Optional Long. Specifies the requested position for the style sheet in the collection. If omitted, the style sheet is added to the end of the collection.

Remarks

Use the removeImport method to remove an imported style sheet from the collection of imported style sheets for a STYLE element. Use the imports property to access the collection of imported style sheets for a STYLE element.

Example

The following example checks to see if there are any imported style sheets referenced in the first STYLE element in the active document. If there are no imported style sheets, a new imported style sheet reference is added to the STYLE element.

    Dim objStyle As FPHTMLStyleSheet
Set objStyle = ActiveDocument.styleSheets.Item(0)

If objStyle.imports.Length = 0 Then
    objStyle.addImport ("web.css")
End If