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

    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:

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

    This works:


    Code:
    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:

    Code:
     
    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
      Next
    End Function

  2. #2
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    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: http://msdn.microsoft.com/en-us/libr...84(VS.85).aspx

    and for further instance, this is probably the answer: http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx

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