removeAttribute Method

Microsoft FrontPage Visual Basic

removeAttribute Method

Returns a Boolean that represents whether the attribute was successfully removed. True indicates that the attribute was removed. False indicates that the attribute was not removed.

expression.removeAttribute(strAttributeName, lFlags)

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

strAttributeName    Required String.

lFlags    Optional Integer. Specifies whether to use a case-sensitive search to locate the attribute. 1 (True) indicates that the uppercase and lowercase letters in the specified sAttributeName parameter must exactly match those in the attribute name. 0 (False) indicates that the attribute name match to the sAttributeName parameter is not case sensitive. Default value is 1.

Remarks

When no corresponding property exists for an attribute, use the getAttribute method to get the value of an attribute. When no corresponding property exists for an attribute or when the property that accesses an attribute is read-only, use the setAttribute method to set the value of an attribute.

Example

The following example specifies a source file for the first IMG element in the active document and removes the height and width attributes since the new image may have a different height and width.

    Set objImage = ActiveDocument.images.Item(0)

With objImage
    .src = "graphics/chelan.jpg"
    .removeAttribute "height", False
    .removeAttribute "width", False
End With