VBA getElementById with dynamic ID

后端 未结 2 881
温柔的废话
温柔的废话 2021-01-21 16:43

I\'ve been searching this whole forum, msdn and specialised tutorials and I can\'t find the answer for VBA: How can I make the getElementById work in an access VBA

2条回答
  •  有刺的猬
    2021-01-21 17:12

    Try something like this one:

    Dim ContainerDiv As HTMLDivElement, ResultDIV As HTMLDivElement
    
    Set ContainerDiv = HTMLDoc.getElementById("rowToolTipContainer")
    For Each ResultDIV In ContainerDiv.GetElementsByTagName("div")
        If ResultDIV.ID Like "resultsTooltip*Contents" Then
    
            '' What do you want to do here?
    
            Exit For
        End If
    Next
    

提交回复
热议问题