Re: VBA and switching focus between applications



I have some sample code for automating Internet Explorer here:

http://codeforexcelandoutlook.com/automateinetexplorer.html
http://tinyurl.com/2twmh9

It depends on what type of website you are accessing, but a lot of
them can be accessed via code. Keep in mind it might be less tedious
to push a button, but the VBA code in many cases will be slower.


HTH,
JP

On Mar 19, 2:47 pm, "Valmont" <notrelev...@xxxxxxxxxxxxx> wrote:
An employee works with a VBA application (form in Word 2003), side by side
with a page on Internet Explorer. From that webpage he copies manually
data to controls in the userform. This costs too much (time).

My solution would be to build additional functions in VBA. It goes like
this:
1) Press a button on the form.
2) The code behind "button_clicked" event switches focus to the open
Internet Explorer webpage (defined by the windowtitle in he blue area).
3) I use sendkeys CTRL_A then CTRL_Copy to copy the webpage contents to
the clipboard.
4) Event switches back to the VBA form (Word 2003 instance).
5) VBA code analyses the data on the clipboard and copies the right stuff
to the controls.

.