How to cast mshtml.IHTMLDivElement to mshtml.HTMLDivElementClass?
IHTMLElementCollection collection = doc.body.all;
foreach (var htmlElem in collection)
{
if (htmlElem is mshtml.IHTMLDivElement)
{
mshtml.IHTMLDivElement div = htmlElem as mshtml.IHTMLDivElement;
if (div != null)
{
// HTMLDivElementClass divClass = (HTMLDivElementClass)div; ?????????
}
}
}
I need to access HTMLDivElementClass to be able to get all members of it.

Your code almost correct. Not sure what you want.
Please change your code like below
It is working for me and in “div” object is of the type “HTMLDivElementClass”
And one more suggestion if you want to all the DIV tag only from the page then use the following line of code.
Instead of
That will remove your condition to check element is DIV or not.
Hope this help to you.