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

x
?
Solved

Copy all from webbrowser

Posted on 2011-02-17
4
Medium Priority
?
312 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

593 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