Solved

Focusing on a WScript IE explorer window

Posted on 2003-11-11
8
799 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
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

831 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