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

Applies to | FPHTMLAnchorElement Object | FPHTMLAreaElement Object | FPHTMLBaseElement Object | FPHTMLBaseFontElement Object | FPHTMLBGsound Object | FPHTMLBlockElement Object | FPHTMLBody Object | FPHTMLBRElement Object | FPHTMLButtonElement Object | FPHTMLCommentElement Object | FPHTMLDDElement Object | FPHTMLDivElement Object | FPHTMLDivPosition Object | FPHTMLDListElement Object | FPHTMLDTElement Object | FPHTMLEmbed Object | FPHTMLFieldSetElement Object | FPHTMLFontElement Object | FPHTMLFormElement Object | FPHTMLFrameBase Object | FPHTMLFrameElement Object | FPHTMLFrameSetSite Object | FPHTMLFrontPageBotElement Object | FPHTMLHeaderElement Object | FPHTMLHRElement Object | FPHTMLIFrame Object | FPHTMLImg Object | FPHTMLInputButtonElement Object | FPHTMLInputFileElement Object | FPHTMLInputHiddenElement Object | FPHTMLInputImage Object | FPHTMLInputTextElement Object | FPHTMLIsIndexElement Object | FPHTMLLabelElement Object | FPHTMLLegendElement Object | FPHTMLLIElement Object | FPHTMLLinkElement Object | FPHTMLListElement Object | FPHTMLMapElement Object | FPHTMLMarqueeElement Object | FPHTMLMetaElement Object | FPHTMLNextIdElement Object | FPHTMLNoShowElement Object | FPHTMLObjectElement Object | FPHTMLOListElement Object | FPHTMLOptionElement Object | FPHTMLParaElement Object | FPHTMLPhraseElement Object | FPHTMLScriptElement Object | FPHTMLSelectElement Object | FPHTMLSpanElement Object | FPHTMLSpanFlow Object | FPHTMLStyle Object | FPHTMLStyleElement Object | FPHTMLTable Object | FPHTMLTableCaption Object | FPHTMLTableCell Object | FPHTMLTableCol Object | FPHTMLTableRow Object | FPHTMLTableSection Object | FPHTMLTemplateRegionElement Object | FPHTMLTextAreaElement Object | FPHTMLTextElement Object | FPHTMLTitleElement Object | FPHTMLUListElement Object | FPHTMLUnknownElement Object | FPHTMLWebPartElement Object | FPHTMLWebPartZoneElement Object | FPHTMLXSLElement Object | FPHTMLXSLWebPartElement Object | IHTMLElement Object | IHTMLRuleStyle Object | IHTMLStyle Object