One of my challenges is checking whether an element in a table has the property float: left or float: right to determine its relation. Unfortunately, the .getAttribute("Style") method only works for inline HTML styling, not CSS. When I tried using it, it returned [object MSStyleCSSProperties]. Here's the code snippet that didn't work as expected:
Dim htmlele As IHTMLElement
Dim PopUpWindow As Object
For Each htmlele In PopUpWindow.document.getElementsByTagName("tr")
If InStr(htmlele.getAttribute("Style"), "float: left;") <> 0 Then
'do stuff
End if
Next htmlele
I'm wondering if there is a way to manipulate CSS through VBA at all?