Results 1 to 2 of 2
  1. #1
    smikkelsen is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Mar 2010

    VBA DOM help

    I am trying to figure out how to get the document title with dom.

    Here is an example of what I thought would work:

    msgbox myIE.document.Title
    msgbox myIE.Title
    That tells me that the "Object doesn't support this property or method"

    This works:

    msgbox myIE.URL
    Can anyone that uses DOM tell me how to find the page title??

    This is killing me, I can do everything else, but this.

    Also as a side note, I have this function that finds the page title just fine:

    Function IE_FindOpenInstance(i_Title, _
                              Optional ByVal i_ExactMatch As Boolean = True) As SHDocVw.InternetExplorer
    Dim objShellWindows As New SHDocVw.ShellWindows
      If i_ExactMatch = False Then i_Title = "*" & i_Title & "*"
      'ignore errors when accessing the document property
      On Error Resume Next
      'loop over all Shell-Windows
      For Each IE_FindOpenInstance In objShellWindows
        'if the document is of type HTMLDocument, it is an IE window
        If TypeName(IE_FindOpenInstance.Document) = "HTMLDocument" Then
          'check the title
          If IE_FindOpenInstance.Document.Title Like i_Title Then
            'leave, we found the right window
            Exit Function
          End If
        End If
    End Function

  2. #2
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    what you need is the page on the Microsoft Developer Network (MSDN) website that gives you a blanket list of all the properties associated with the VBA internet explorer object. A google search might serve you well.

    for instance:

    and for further instance, this is probably the answer:

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Other Forums: Microsoft Office Forums