domain 属性

       

返回或设置 String 类型的值,该值代表当前文档的域名。 域代表文档所在的服务器名称或与文档关联的 Web 地址。可读写。

expression.domain

expression  必选。返回 dispFPHTMLDocument 对象的表达式。

示例

如果域名存在,下列示例将显示当前文档的域名。如果文档的 domain 属性为空,则向用户显示一条消息。

Sub DomainName()
'Displays the domain name for the current document

    Dim objApp As FrontPage.Application
    Dim objDoc As DispFPHTMLDocument
    Dim strAns As String

    Set objApp = FrontPage.Application
    Set objDoc = objApp.ActiveDocument
    'If domain name exists
    If objDoc.domain <> "" Then
        MsgBox "The name of the current document's domain server is " & _
               objDoc.domain & "."
    Else
       'Otherwise, display message to user
       MsgBox "The document " & objDoc.Title & _
              " does not have an associated domain name."
    End If

End Sub