?
Solved

Copy all from webbrowser

Posted on 2011-02-17
4
Medium Priority
?
307 Views
Last Modified: 2012-06-27
For some reason, the following code isn't working.  It worked the first time I tried it and now isn't:

I'm basically trying to copy-paste all the info from a webbrowser.

Private Sub Command15_Click()
    WebBrowser1.SetFocus
    SendKeys ("^A^C")
    item_description.SetFocus
    SendKeys ("^V")
End Sub
0
Comment
Question by:hrolsons
[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
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Den_HBR
ID: 34923916
I have heard that some people have to use lowercase.
Try
Private Sub Command15_Click()
    WebBrowser1.SetFocus
    SendKeys ("^a^c")
    item_description.SetFocus
    SendKeys ("^v")
End Sub

Open in new window

0
 

Author Comment

by:hrolsons
ID: 34926495
Still not grabbing the contents of webbrowser.  It's strange, because if I change the code to:

Private Sub Command15_Click()
    WebBrowser1.SetFocus
End Sub

After I press Command15 I then manually pres:

ctrl-a
ctrl-s
click on item_description
click ctrl-v

It works perfect.
0
 
LVL 8

Accepted Solution

by:
Den_HBR earned 2000 total points
ID: 34927025
Below works for me
 
WebBrowser1.SetFocus
SendKeys ("^a^c")
DoEvents
item_description.SetFocus
SendKeys ("^v")

Open in new window


(don't forget to try with capitals if lower case doesn't work for you)
0
 

Author Closing Comment

by:hrolsons
ID: 34927198
DoEvents did the trick.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

752 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