DotNetNewbie
Programmer
Hi,
I wrote a VBScript some years ago to do a multitude of things when a user logs in. Part of this was an IE window that was used to display any emergency message which included a JPG image that was copied to the local machine.
The file copy process works fine, unfortunately the image is now no longer displayed in IE7 or IE8. I have searched around and found varies pieces of code but unfortunately they also have the same issue.
If anyone can give me some advice I would be most grateful:
Set MSIE = CreateObject("InternetExplorer.Application")
Logo = "C:\Companylogo.jpg"
sTitle = "Emergency Message"
MSIE.Navigate "About:Blank"
MSIE.ToolBar = False
MSIE.StatusBar = False
MSIE.Resizable = False
Do
Loop While MSIE.Busy
SWidth = MSIE.Document.ParentWindow.Screen.AvailWidth
SHeight = MSIE.Document.ParentWindow.Screen.AvailHeight
MSIE.Width = Swidth/2
MSIE.Height = SHeight/2
MSIE.Left = (SWidth - MSIE.Width)/2
MSIE.Top = (Sheight - MSIE.Height)/2
MSIE.Visible = True
MSIE.Document.Write "<HTML><TITLE>" & sTitle & "</TITLE><BODY bgcolor=#FFFFFF><FONT FACE=Verdana>"
MSIE.Document.Write "<p><img border=0 src=" & logo & " width=272 height=121></p><hr>"
If Hour(Now) < 12 Then
MSIE.Document.Write "<B>Good Morning"</B><BR><BR>"
ElseIf Hour(Now) < 18 Then
MSIE.Document.Write "<B>Good Afternoon"</B><BR><BR>"
Else
MSIE.Document.Write "<B>Good Evening"</B><BR><BR>"
End If
MSIE.Document.Write "</FONT></BODY>"
Wscript.Sleep 3000
MSIE.Quit
Many thanks,
David
I wrote a VBScript some years ago to do a multitude of things when a user logs in. Part of this was an IE window that was used to display any emergency message which included a JPG image that was copied to the local machine.
The file copy process works fine, unfortunately the image is now no longer displayed in IE7 or IE8. I have searched around and found varies pieces of code but unfortunately they also have the same issue.
If anyone can give me some advice I would be most grateful:
Set MSIE = CreateObject("InternetExplorer.Application")
Logo = "C:\Companylogo.jpg"
sTitle = "Emergency Message"
MSIE.Navigate "About:Blank"
MSIE.ToolBar = False
MSIE.StatusBar = False
MSIE.Resizable = False
Do
Loop While MSIE.Busy
SWidth = MSIE.Document.ParentWindow.Screen.AvailWidth
SHeight = MSIE.Document.ParentWindow.Screen.AvailHeight
MSIE.Width = Swidth/2
MSIE.Height = SHeight/2
MSIE.Left = (SWidth - MSIE.Width)/2
MSIE.Top = (Sheight - MSIE.Height)/2
MSIE.Visible = True
MSIE.Document.Write "<HTML><TITLE>" & sTitle & "</TITLE><BODY bgcolor=#FFFFFF><FONT FACE=Verdana>"
MSIE.Document.Write "<p><img border=0 src=" & logo & " width=272 height=121></p><hr>"
If Hour(Now) < 12 Then
MSIE.Document.Write "<B>Good Morning"</B><BR><BR>"
ElseIf Hour(Now) < 18 Then
MSIE.Document.Write "<B>Good Afternoon"</B><BR><BR>"
Else
MSIE.Document.Write "<B>Good Evening"</B><BR><BR>"
End If
MSIE.Document.Write "</FONT></BODY>"
Wscript.Sleep 3000
MSIE.Quit
Many thanks,
David