This documentation is archived and is not being maintained.

FPHTMLBaseElement Object

Office 2003
Multiple objects

Represents the BASE element of an HTML document. Use the FPHTMLBaseElement object to specify the base URL for all relative URLs in a Web page. You can also use the FPHTMLBaseElement object to specify the base target window for all hyperlinks that do not specify a target window. See also the IHTMLBaseElement object.

Using the FPHTMLBaseElement object

Use the Item method to return an FPHTMLBaseElement object. The following example takes an FPHTMLDocument object and a String that represents the target window all hyperlinks in the document will use unless otherwise specified.

    Function SetBaseTarget(objDoc As FPHTMLDocument, _
        strTarget As String) As FPHTMLBaseElement
    Dim objHead As IHTMLElement
    If objDoc.all.tags("base").Length <= 0 Then
        Set objHead = objDoc.all.tags("head").Item(0)
        objHead.insertAdjacentHTML "beforeend", "<Base id=""basetarget"">"
        Set SetBaseTarget = objHead.all.tags("base").Item("basetarget")
        Set SetBaseTarget = objHead.all.tags("base").Item(0)
    End If = strTarget
End Function

Use the following example to call the preceding function.

    Sub CallSetBaseTarget()
    Call SetBaseTarget(ActiveDocument, "_blank")
End Sub

Parent Objects