?
Solved

Focusing on a WScript IE explorer window

Posted on 2003-11-11
8
Medium Priority
?
804 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 100 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 100 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
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.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

801 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