|
-
Oct 17th, 2013, 02:36 PM
#16
New Member
Re: Highlighting Text in a Web Browser Control
Hi iPrank,
I like your solution to highlighting text in a WB!
1. This is my first post on this forum. Possible I should start new thread, but I not sure.
2. I have question to you. ***Is it possible to copy the content of one Web Browser control to another one in VB6?***
Assume that WebBrowser1 is currently loaded (like WebBrowser1.Navigate "www.yahoo.com").
Following to your example I tried
Private Sub cmdClone_Click()
Dim doc As HTMLDocument
Dim tr As IHTMLTxtRange
Dim doc1 As HTMLDocument
Dim tr1 As IHTMLTxtRange
Dim sSourceHtml As String
WebBrowser2.Silent = True
WebBrowser2.Navigate ("about:blank")
Set doc = WebBrowser1.Document
Set tr = doc.body.createTextRange
DoEvents
sSourceHtml = tr.htmlText
DoEvents
Set doc1 = WebBrowser2.Document
Set tr1 = doc1.body.createTextRange
DoEvents
tr1.pasteHTML sSourceHtml
DoEvents
End Sub
This procedure refreshes the second browser but instead or pictures it shows icons, it damages the page layout etc. What I am doing wrong? Can this cloning be done? Of course I can get the URL of first WB and use it to load second WB, but it works too slow. Or there is no way to clone the browser content without connedction to web server?
Please advice.
Thanks!
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
|