Solved

Focusing on a WScript IE explorer window

Posted on 2003-11-11
8
803 Views
Last Modified: 2012-05-04
I'm not very familiar with VBScript, in fact this is my first day dealing with it. I'm basing most of the script off of an earlier version.   Basically all the program does is open an IE window (via WScript) load the HTML, then send the information from the form to a perl script.  That is all working fine, but I can't get the Script to focus on the IE window, so it opens behind everything else.  I've looked all over the place and can't seem to find anything that will help, so I am giving in and asking people.

The code I have involving the window is

dim oIE

set oIE = WScript.CreateObject("InternetExplorer.Application", IE_)
//
|| Code defining the window size, etc
\\
oIE.navigate pathe & "LMP_Form.htm"
oIE.visible = 1



0
Comment
Question by:trunks2k
[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
8 Comments
 

Accepted Solution

by:
alibabas earned 25 total points
ID: 9725358
Try the following code... or at least part of it.. you can tweak as you like.

'code start
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "www.google.com
IE.visible=1 ' ignore this line if you dont want the browser to be visible  
' let the page load
Do while IE.busy
loop
Do While UCase(IE.Document.readyState) <> "COMPLETE"
     WScript.Sleep 100
   DoEvents
Loop
'now close ie
IE.Quit
set IE=nothing
'code ends
0
 
LVL 5

Assisted Solution

by:fantasy1001
fantasy1001 earned 25 total points
ID: 9727242
Do you want a perl solution for this? I mean we can grab the content of the site in html in perl directly.

~ fantasy ~
0
 

Author Comment

by:trunks2k
ID: 9732199
alibabas:

That's pretty much what is there already.

fantasy1001:

sure, I'll take a perl solution.
0
Independent Software Vendors: 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!

 

Expert Comment

by:alibabas
ID: 9732583
Fantasy,

I don't know why you have the IE open up in the background... I used the smae code adn got it to come up in front/top off all my other screens..  I commented out the ie.quit and set to nothing..and it stays to the top.

also.. not sure if you have gone to the following page.. but check it out.. it might help.

http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/reference/objects/internetexplorer.asp

Good luck.
0
 
LVL 5

Expert Comment

by:fantasy1001
ID: 9735981
This example show you how to grab a html content using perl:

#!/bin/perl
use LWP::Simple;
use HTML::Parse;
     
    print (get $ARGV[O]);    # use this if you want html format of text
    print parse_html(get ($ARGV[0]))->format;      # use this if you want all the tag stripped out
 
you can run the script by passing an url to it like this

%>> perl myscript.pl www.google.com

~ fantasy ~
 
 

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10537208
Moderator, my recommended disposition is:

    Split points between: alibabas and fantasy1001

Dan Rollins -- EE database cleanup volunteer
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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…

726 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