Function RenderHTML(myMessage)
Dim objIExplorer
Dim objFileSystem
Dim objDocument
Dim objWMIService
Dim colServices
Dim objService
Dim strComputer
Set objIExplorer = CreateObject("InternetExplorer.Application")
Set objFileSystem = CreateObject("Scripting.FileSystemObject")
objIExplorer.Navigate "about:blank"
objIExplorer.AddressBar = 0
objIExplorer.Height = 400
objIExplorer.Width = 580
objIExplorer.MenuBar = 0
objIExplorer.StatusBar = 0
objIExplorer.ToolBar = 0
objIExplorer.Left = 50
objIExplorer.Top = 50
objIExplorer.Visible = 1
Do While (objIExplorer.Busy)
Wscript.Sleep 250
Loop
Set objDocument = objIExplorer.Document
objDocument.Open
objDocument.Writeln "<html><head><title>Backup</title></head>"
objDocument.Writeln "<body bgcolor='ffffff'>"
objDocument.Writeln myMessage
objDocument.Writeln "</body></html>"
objDocument.Write()
objDocument.Close
End Function
'Make window adjustments here (examples follow)
ie.Document.ParentWindow.opener="me" 'allows self.close()
ie.Document.ParentWindow.resizeTo 600,400 'size
ie.toolbar = false 'appearance
'This section brings the new ie to the foreground
Randomize: myRand = Rnd()
ie.Document.title = myRand 'a unique title
ie.Visible = true 'must be visible for AppActivate
With CreateObject("WScript.Shell")
Do until .AppActivate(myRand & " - M") : Wscript.Sleep 10: Loop
End With
ie.Document.title = title
set newIEtoForeground = ie
End Function
Csaba Gabor from Vienna
"Csaba2000" <cs...@z6.com> wrote in message
news:ut3c1zcH...@TK2MSFTNGP09.phx.gbl...
' objDocument.Writeln "<html><head><title>Backup</title></head>"
' objDocument.Writeln "<body bgcolor='ffffff'>"
' objDocument.Writeln myMessage
' objDocument.Writeln "</body></html>"
' objDocument.Write()
newDoc = "<html><head><title>Backup</title></head>" & _
"<body bgcolor='ffffcc'>" & myMessage & _
"</body></html>"
objDocument.Write (newDoc)
Note that the first if statement in newIEtoForeground, below,
got wrapped. The if should be on one line and the Else on the
next line.
Csaba
"scott" <sba...@mileslumber.com> wrote in message
news:u0rVFdfH...@tk2msftngp13.phx.gbl...
Do you have any sample code or links?
"Csaba2000" <cs...@z6.com> wrote in message
news:OhGRRGgH...@TK2MSFTNGP09.phx.gbl...
> Going by my 1st function, is it possible to open the pop-up window, then do
> certain tasks, then write the results back to the open pop-up?
>
> Do you have any sample code or links?
Hi
An example on using an Internet Explorer window where you can
dynamically put out information about what is going on:
http://groups.google.co.uk/groups?selm=3EA302E5.5BAE90EB%40hydro.com
If you want a scrolling window (keeping the messages already displayed),
try this script (this is what I use in our logon script):
http://groups.google.co.uk/groups?selm=400F20F1.AD140C21%40hydro.com
In case people has used the search bar in IE in their previous logon
session, you should turn it off before opening IE, setting the
ShowBrowserBar property before you call the SetupMSIE sub, like the
code in this post:
http://groups.google.co.uk/groups?selm=40326016.D28ABB5B%40hydro.com
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx