setToDefault Method

Microsoft FrontPage Visual Basic

setToDefault Method

Sets a specified style attribute to its default value.

expression.SetToDefault(strAttributeName)

expression    Required. An expression that returns an IFPStyleState object.

strAttributeName    Required String. The name of the style attribute. You can get a list of style attributes from the CSS Reference on the Microsoft Developer Network (MSDN) Web site.

Remarks

Use the apply method to apply the changes to the text range or element.

Example

The following example resets the background color and font size of the selected text to its default value.

    Dim objSs As IFPStyleState
Dim objRng As IHTMLTxtRange

Set objRng = ActiveDocument.Selection.createRange
Set objSs = ActiveDocument.createStyleState

With objSs
    .gather objRng
    .setToDefault "background-color"
    .setToDefault "font-size"
    .Apply
End With