modularbeing
Regular
- Joined
- Jan 8, 2004
- Messages
- 63
Hello,
I am pulling a stream of html from a webservice and I need to replace some image tags with another control. I originally was going to parse this as a string using instr() but I was looking at the mshtml assembly and thought that this might work better for me. I wrote some code that looks like it will find all the IMG tags and put them into the IHTMLElementCollention. once I have found all the image tags, is there a way I can use mshtml to replace those tags with web controls? previously I was using
to add a web control but I do not know if I can do this with mshtml.
This is the code that I have so far to search for the IMG tags in the document, I have not tested it yet.
Thanks
I am pulling a stream of html from a webservice and I need to replace some image tags with another control. I originally was going to parse this as a string using instr() but I was looking at the mshtml assembly and thought that this might work better for me. I wrote some code that looks like it will find all the IMG tags and put them into the IHTMLElementCollention. once I have found all the image tags, is there a way I can use mshtml to replace those tags with web controls? previously I was using
Code:
MyBase.Controls.Add(chkSignature(0))
This is the code that I have so far to search for the IMG tags in the document, I have not tested it yet.
Code:
Dim HTMLContent As New HTMLDocument
HTMLContent = DirectCast(strContent, HTMLDocument)
Dim colHTMLElements As IHTMLElementCollection = HTMLContent.getElementsByTagName("IMG")
Dim HTMLElement As IHTMLElement
For Each HTMLElement In colHTMLElements
'Replace Image tags
Next