I need to get the offset position of tag…
I am using
HtmlElementCollection sp = textwebBrowser1.Document.GetElementsByTagName("span");
to get a collection of span tags….but in some cases even if i have span tags in the page,the count of the collection is zero…I guess it is because of some object tags with image information in between…example-
I don’t know how to retrieve the offset of span tag in this case
HTML CODE:
<HTML><BODY>.....Using <OBJECT> and <EMBED><HTML><HEAD><TITLE>A Web page with a rolling die</TITLE></HEAD><BODY><OBJECT ID="Dieroll1"CLASSID="CLSID:46646B43-EA16-11CF-870C-00201801DDD6"CODEBASE="dieroll.cab#Version=1,0,0,1"WIDTH="200"HEIGHT="200"><PARAM NAME="ForeColor" VALUE="0"><PARAM NAME="BackColor" VALUE="16777215"><PARAM NAME="Image" VALUE="beans.bmp"><EMBED LIVECONNECT NAME="Dieroll1"WIDTH="200"HEIGHT="200"CLASSID="CLSID:46646B43-EA16-11CF-870C-00201801DDD6"TYPE="application/oleobject"CODEBASE="dieroll.cab#Version=1,0,0,1"PARAM_ForeColor="0"PARAM_BackColor="16777215"></OBJECT><BR>Hthe die</BODY></HTML>Arrange to run Explorer when you debug the control.Here's the syntax for an OBJECT tag that sets the Image property:<OBJECTCLASSID="clsid:46646B43-EA16-11CF-870C-00201801DDD6"CODEBASE="http://www.gregcons.com/test/dieroll.ocx"ID=die1WIDTH=200HEIGHT=200ALIGN=centerHSPACE=0VSPACE=0><PARAM NAME="Dots" VALUE="1"><PARAM NAME="Image" VALUE="http://www.gregcons.com/test/beans.bmp">and the <span style='background-color: rgb(255, 255, 0);'>image</span> file you are using....</BODY></HTML>
I used your html code in your question and i got all span tag with following code:(code must run after page loaded)