|
-
Aug 30th, 2005, 02:24 PM
#1
Thread Starter
New Member
Selected HTML code in a axWebBrowser control
Hi,
One of my forms is using an axWebBrowser to display a webpage, I need the avility to select some part of the document and put that HTML code in a variable.
I've tryed with .innerHTML and .outterHTML in the HTMLDocumentClass obtained from the .Document, but it doesn't work since it copies all the HTML code from that section, and I just need the selected part.
Thanks,
Angel
-
Aug 30th, 2005, 06:27 PM
#2
Thread Starter
New Member
Re: Selected HTML code in a axWebBrowser control
Well I did it like this, maybe this'll be useful for someone so be happy 
VB Code:
Dim objHtmlDocument As mshtml.HTMLDocument
Dim objRange As mshtml.IHTMLTxtRange
Try
objHtmlDocument = CType(Me.wbrContent.Document, mshtml.HTMLDocument)
objRange = objHtmlDocument.selection.createRange
If objRange.htmlText.Trim = String.Empty Then
...
Else
MsgBox(objRange.htmlText.Trim)
End If
Catch ex As Exception
Finally
objRange = Nothing
objHtmlDocument = Nothing
End Try
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|