Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Controlling Internet Explorer

Reply
 
Old 11-14-2008   #1 (permalink)
Martin Gilday


 
 

Controlling Internet Explorer

I am writing a powershell script to attempt to assist our call centre agents
with data capture. They must fill in two websites with almost identical
questions (but different order and on different pages of the application).
Follow part of Powershell in Action I am attempting to control Internet
Explorer. I can then grab the values from one DOM and copy them into the DOM
of the other window. In addition to this I have a Windows form set to always
on top which allows the agent to control the copying and also which window is
displayed. This is as we run their IE in full screen kiosk mode.

So there is something like this (Variable names changed to remove company
names):

$ie1 = New-Object -com "InternetExplorer.Application"
$ie1.Visible = $true
$ie1.FullScreen = $true
$ie1.Navigate2($url1)

Same for $ie2

$form = New-Object Windows.Forms.Form
$buttonDisplay1 = New-Object Windows.Forms.Button
$buttonDisplay1.Text = "Display 1"
$buttonDisplay1.Dock = "fill"
$buttonDisplay1.add_click({
$ie1.Visible = $true
$ie2l.Visible = $false
})
.......
.......
$form.ShowDialog()

This all works fine when I use navigate2 to change to a file on my local
machine (e.g. C:\example.html). I can then press the copy button, press the
switch window button.

However as soon as I change the parameter to any HTTP address then it stops
working. The window DOES navigate to the URL but then the COM object becomes
disconnected showing the following error:
Exception setting "Visible": "The object invoked has disconnected from its
clients. (Exception from HRESULT: 0x80010108
(RPC_E_DISCONNECTED))"

Does anyone know why this may be? My initial thoughts are that it is some
sort of security policy, but then why does it navigate before disconnnecting?

Thanks,
Martin.

My System SpecsSystem Spec
Old 11-14-2008   #2 (permalink)
Martin Gilday


 
 

RE: Controlling Internet Explorer

I've found that actually whenever I call navigate2 it actually opens another
IE window in which to load the URL. But it reuses this new window for each
subsequent navigate but opens a new tab. This is quite problematic when
trying to change pages within the same application form.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
controlling windows explorer on vista? Vista General
Vista Internet Explorer/Windows Explorer shortcut problem Vista General
Controlling Internet Download Volume on Home Network Vista account administration
Controlling 'type' of Windows Explorer Vista file management
Controlling How Windows Explorer Opens Vista file management


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46