Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB6 Classic - Webbrowser double click

Posted on 2015-01-16
5
Medium Priority
?
93 Views
Last Modified: 2015-02-13
Hi

Yes, still using Classic :-)

Would anyone have some code that shows how to double click text on a Web page and then throw it to the Clipboard, based on certain criteria? In my case, I need to allow thi scenario only when the text matches four letters and seven numbers I.e ABCD1234567.

Thanks.
0
Comment
Question by:tvtech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 20

Expert Comment

by:ltlbearand3
ID: 40554707
Can you use one of the browser objects to open the page and extra the data from the HTML source that way?  Maybe something like one of these:

When you say click on text, is the text a hyperlink and you want the value that comes from the link?

Dim objHttp, objXMLDoc

Set objHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
Set objXMLDoc = CreateObject("Msxml2.DOMDocument") 

With objHttp
	.Open "GET", "http://www.yoursite.com"
	.Send
	objXMLDoc.LoadXML .responseText
End With

msgbox objXMLDoc.SelectSingleNode("//YourNodeName").text

set objHttp = nothing
set objXMLDoc = nothing

Open in new window


Sub GetWebTitle()
	' Need References set to 
      ' MICROSOFT INTERNET CONTROLS
      ' MICROSOFT HTML OBJECT LIBRARY

    Dim objHTML As HTMLDocument
    Dim objTitleElem As IHTMLElementCollection
    Dim objIE As InternetExplorer
    
    Set objIE = New InternetExplorer
    
    With objIE
        ' Enter in the website here
        .navigate "http://www.experts-exchange.com/"
        
        ' Don't show IE as we open it
        .Visible = False
        
        ' Pause while IE Loads
        Do While .Busy Or .readyState <> READYSTATE_COMPLETE
            DoEvents
        Loop
        
        ' Load the web page into an HTML Document
        Set objHTML = .document
    End With
    
    ' Look for the all instances of the tag
    Set objTitleElem = objHTML.getElementsByTagName("Title")
    
    
    ' Put the value from the first instance in cell A1
    Range("A1").Value = objTitleElem.Item(0).outerText
    
End Sub

Open in new window

0
 

Author Comment

by:tvtech
ID: 40555763
Thanks for your comment.

The text is not hyperlinked. Just plain text.
0
 
LVL 20

Accepted Solution

by:
ltlbearand3 earned 2000 total points
ID: 40555840
Since it is plan text, I suggest looking at one of the methods I posted.  You could always do a view source from the web page to see how the data is stored and then use one of the examples posted to help parse the data.
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 40607543
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question