For Programmers: Free Programming Magazines  


Home > Archive > WSH > January 2005 > Open IE with Script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Open IE with Script
Diego Truffer

2005-01-11, 8:55 am

Hy NG,

I have a problem... I have 2 Monitors on my Info-PC.
I would start 2 iexplore on both Monitors (but not the
same).

To start the iexplore I have 2 Scripts....
start.vbs
***************************************
Set osh2 = CreateObject("wscript.Shell")
Set osh3 = CreateObject("wscript.Shell")

osh2.run "C:\web\web1\loadsite.vbs"
osh3.run "C:\web\web2\loadsite.vbs"

WScript.Quit
***************************************

loadsite.vbs
***************************************
' Time for one Site
anzsec = 20

' How many Sites are existing
anzseiten = 3

pfad = "C:\web\web1\"
sec = 1000
'-------------------------------------------------------'

set ie6 = WScript.CreateObject("InternetExplorer.Application", "event_")
ie6.navigate (pfad & "seite1.htm")
ie6.visible = True
ie6.FullScreen = True

'warten bis alle Daten erhalten
do loop while ie6.ReadyState<>4
On Error Resume next
do
for i = 1 to anzseiten
WScript.Sleep anzsec * sec
ie6.navigate (pfad & "seite" & i & ".htm")
next
loop while True
next
***************************************

Do I have a possibility, to made this with WScript?

If not, whit which program-code can I made this?

If I made it from hand, I have to bring the Secondary
Montior on the right site from the Primary Monitor, start
the first script, wait if the script is finished, start the
second script. After both scripts are running, I have to
change the secondary Monitor on the bottom of the
Primary Monitor, so that I can see on both Monitors the
both Webs.

We have every month on or more electrical power outage...
So I'll be crazy with this workaround.

I didn't found any solution to start the wshell in a
specific Monitor, I searched 1 w with google and
I didn't found something, also in the TechNet, I
haven't found something and I'm really despair.

Thanks for your help, tipps and tricks ;)

Cheers
Diego

Additionally: I wrote this also on
microsoft.public.de.german.scripting.wsh but I
became non answer (Topic: PC als Info-PC)


Miyahn

2005-01-11, 3:55 pm

"Diego Truffer" wrote in message news:41e3c755$0$3410$5402220f@news.sunrise.ch
> I have a problem... I have 2 Monitors on my Info-PC.
> I would start 2 iexplore on both Monitors (but not the
> same).


Before you set IE's window state to maximize, set window position.

With CreateObject("InternetExplorer.Application")
.Navigate "about :blank"
.Top = 0
.Visible = True
.Left = .document.parentwindow.screen.availwidth + 1
.FullScreen = True
End With

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP (Office Systems - Excel)
HQF03250@nifty.ne.jp

Diego Truffer

2005-01-11, 3:55 pm

Hy,

my Settings:
Desktop (Properties of Display settings):
---------------------------------------------------------
Monitor 1: Top 0, Left 0
Monitor 2: Top 0, Left 1024
---------------------------------------------------------

Script 1 (First IE)
****************************************

With ie6
.Navigate (pfad & "seite1.htm")
.Top = 0
.Left = 0
.Visible = True
.FullScreen = True
End With
****************************************


Script 2 (Second IE)
****************************************

With ie6
.Navigate (pfad & "seite1.htm")
.Top = 0
.Left = 1025
.Visible = True
.FullScreen = True
End With
****************************************


Result:
The first IE is good, the second IE is not visible...
To see the second IE, change Desktop:
---------------------------------------------------------
Monitor 1: Top 0, Left 0
Monitor 2: Top 768, Left 0
---------------------------------------------------------

Why???

If I change the settings from the Monitor to the
second value and I'll open a IE, the second IE
will overlap the first... And the Second Monitor
will be clear...

Do you have me any solutions???

Sorry for the bad news and thanks in advantage
for the answer.

Cheers
Diego


Miyahn

2005-01-11, 3:55 pm

"Diego Truffer" wrote in message news:41e3ea40$0$3410$5402220f@news.sunrise.ch
> Script 1 (First IE)
> ****************************************

> With ie6
> .Navigate (pfad & "seite1.htm")
> .Top = 0
> .Left = 0
> .Visible = True
> .FullScreen = True
> End With
> ****************************************

>
> Script 2 (Second IE)
> ****************************************

> With ie6
> .Navigate (pfad & "seite1.htm")
> .Top = 0
> .Left = 1025
> .Visible = True
> .FullScreen = True
> End With
> ****************************************

>
> Result:
> The first IE is good, the second IE is not visible...
> To see the second IE, change Desktop:
> ---------------------------------------------------------
> Monitor 1: Top 0, Left 0
> Monitor 2: Top 768, Left 0
> ---------------------------------------------------------
>
> Why???


Sorry I can not explain that result.
Maybe FullScreen method causes the problem.

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP (Office Systems - Excel)
HQF03250@nifty.ne.jp

Diego Truffer

2005-01-12, 8:55 am

Hy Miyahn,

I think, the problem is difficult... Do I haven't a possibility to say, in
which Monitor Windows have to open a application???

Greets
Diego


Miyahn

2005-01-12, 8:55 am

"Diego Truffer" wrote in message news:41e4d7ad$0$3414$5402220f@news.sunrise.ch

Hi.
I can't use dual-display environment now, so can't test the code.
But the following code worked for Microsoft Excel.

Dim xlApp As New Excel.Application
Dim MaxWidth As Long
With xlApp
.WindowState = xlMaximized
MaxWidth = .Width
.WindowState = xlNormal
.Visible = True
.Dialogs(xlDialogOpen).Show "C:\ParentFolder\ChildFolder\*.xls"
.Left = MaxWidth + 1
.WindowState = xlMaximized
End With
Set xlApp = Nothing
End Sub

Did you try this?
Script 1 (First IE)
****************************************

With ie6
.Navigate (pfad & "seite1.htm")
.Top = 0
.Left = 0
.Visible = True
End With
****************************************


Script 2 (Second IE)
****************************************

With ie6
.Navigate (pfad & "seite1.htm")
.Top = 0
.Left = 1025
.Visible = True
End With
****************************************

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP (Office Systems - Excel)
HQF03250@nifty.ne.jp

Diego Truffer

2005-01-12, 3:55 pm

Hy Miyahn,

> Did you try this?
> Script 1 (First IE)
> ****************************************

> With ie6
> .Navigate (pfad & "seite1.htm")
> .Top = 0
> .Left = 0
> .Visible = True
> End With
> ****************************************

>
> Script 2 (Second IE)
> ****************************************

> With ie6
> .Navigate (pfad & "seite1.htm")
> .Top = 0
> .Left = 1025
> .Visible = True
> End With
> ****************************************


I tried it... It's running (on both screen, correctly)...
It's just the Fullscreen which isn't running...

I looked at
http://msdn.microsoft.com/library/d.../reflist_vb.asp
to deactivate all (to made fullscreen, but by hand)...

If you has a better link, please let me know.

Thanks you very mutch, for the idea ;) I'm sure,
I'll be found a solution.

And if I didn't found it, I let you know. Otherwise I
wish you a beautiful day.

Thank you very mutch for your help ;)

Cheers
Diego


Diego Truffer

2005-01-13, 8:55 am

Hy Miyahn,

thanks for the tip... I found a solution.

set ie6 = WScript.CreateObject("InternetExplorer.Application", "event_")
With ie6
.Navigate (pfad & "seite1.htm")
.Top = 0
.Left = 1025
.width = 1024
.height = 768

' warten bis alles geladen ist...
do while .ReadyState<>4
loop

' Vollbild deklarieren
.TheaterMode = True
.AddressBar = false
.MenuBar = False
.StatusBar = False
.ToolBar = False

' sichtbar machen
.Visible = True
End With

If I made it with fullscreen, it's not goin, but if I made TheaterMode,
it's going... The online Problem is, I can't made the TitleBar complet
hidden, but it's ok.

Thanks for your help.

Cheers
Diego


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com