Share via


border Property

border property as it applies to the FPHTMLStyle, IHTMLRuleStyle, and IHTMLStyle objects.

Returns or sets a String that represents the border style for the specified object.

expression.border

*expression   * Required. An expression that returns one of the above objects.

Remarks

The String value for the border property can be one or more of the following space-delimited values:

width Any of the values available to the borderWidth property.
style Any of the values available to the borderStyle property.
color Any of the values available to the borderColor property.

border property as it applies to the FPHTMLFrameBase, FPHTMLFrameElement, FPHTMLFrameSetSite, FPHTMLIFrame, FPHTMLImg, FPHTMLInputImage, FPHTMLTable, IHTMLFrameBase, IHTMLFrameSetElement, IHTMLImgElement, IHTMLInputImage, and IHTMLTable objects.

Returns or sets a Variant that represents the width of the object's border in pixels.

expression.border

*expression   * Required. An expression that returns one of the above objects.

Remarks

Setting the border property to zero causes no border to be displayed.

Example

As it applies to the FPHTMLStyle and IHTMLStyle objects.

The following example inserts an opening and closing <P> tag to the active document before the closing BODY element, and then formats the paragraph to include a thick, red, dashed border.

Sub SetParagraphBorderProperties()
    Dim objPara As FPHTMLParaElement
    
    ActiveDocument.body.insertAdjacentHTML where:="beforeend", _
        HTML:="<p id=""newparagraph""></p>"
    
    Set objPara = ActiveDocument.body.all.tags("p").Item("newparagraph")

    objPara.Style.Border = "thick red dashed"
End Sub

As it applies to the FPHTMLImg object.

The following example inserts an image at the end of the active document and sets the width of the image border to 10 pixels. This example assumes that you have an image named "venglobe.gif" in a folder named "images." If you do not, replace the path and file name with an image you do have.

Sub SetImageBorderProperties()
    Dim objImage As FPHTMLImg

    ActiveDocument.body.insertAdjacentHTML where:="beforeend", _
        HTML:="<img src=""images/venglobe.gif"" id=""venus"">"

    Set objImage = ActiveDocument.body.all.tags("img").Item("venus")

    objImage.Border = "10"
End Sub

Applies to | FPHTMLFrameBase Object | FPHTMLFrameElement Object | FPHTMLFrameSetSite Object | FPHTMLIFrame Object | FPHTMLImg Object | FPHTMLInputImage Object | FPHTMLStyle Object | FPHTMLTable Object | IHTMLFrameBase Object | IHTMLFrameSetElement Object | IHTMLImgElement Object | IHTMLInputImage Object | IHTMLRuleStyle Object | IHTMLStyle Object | IHTMLTable Object