Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB Script to open a new web browser window and display text and images

Posted on 2007-11-15
4
Medium Priority
?
1,971 Views
Last Modified: 2013-12-08
I stripped out a lot of stuff out of the code below to simplify my question a little.
I am using a VBS file to open a web browser window and display some text and an image.
The text works fine, but the image does not appear, only the place holder.
I modified the line to display the image a few times adding quotes around the file name with no luck.
Any help would be greatly appreciated.
Thanks!
Dim objIE, objDoc
 
'Open a new browser session
Set objIE = WScript.CreateObject("InternetExplorer.Application")
 
'Set Browser Parameters
objIE.AddressBar = False
objIE.FullScreen = True
objIE.MenuBar = False
objIE.Resizable = False
objIE.Silent = True
objIE.StatusBar = False
objIE.TheaterMode = False
objIE.ToolBar = False
 
objIE.Width = 700
objIE.Height = 500
objIE.Visible = 100
 
objIE.Navigate "about:blank"
objIE.Visible = True
 
Set objDoc = objIE.Document
 
'Display Output Text
objDoc.Write "<html><head>"
objDoc.Write "<title>Hello!</title>"
objDoc.Write "</head>"
objDoc.Write "<body>"
objDoc.Write "<p align=center><font color=#FFFFFF>Space"
objDoc.Write "<p align=center><font color=#FFFFFF>Space"
objDoc.Write "<p align=center><font color=#FFFFFF>Space"
objDoc.Write "<p align=center><font color=#FFFFFF>Space"
objDoc.Write "<p align=center><font color=#000000 size=+2>Displaying Image<br></p>"
objDoc.Write "<p></p>"
objDoc.Write "<p align=center><img src=c:\fileprogress.gif width=546 height=27 border=0></img>"
objDoc.Write "</html>"

Open in new window

0
Comment
Question by:jeffreed
[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
  • 2
  • 2
4 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 20292215
Hi, this line:
objDoc.Write "<p align=center><img src=c:\fileprogress.gif width=546 height=27 border=0></img>"

should be
objDoc.Write "<p align='center'><img src='c:\fileprogress.gif' width='546' height='27' border='0'></img>"

Regards,

Rob.
0
 

Author Comment

by:jeffreed
ID: 20292266
I have tried that and it does not work.  Same results.  I tried this on IE6 and 7 on Win2000 and XP.  Any other suggestions?  
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 20293083
Hi, your code works for me as is, actually, although you are missing a couple of tags.

Add
</p></body>

directly after the </img> tag.

But that didn't really make a difference to functionality.

Can you confirm the file is in exactly that place, case sensitive named?

Regards,

Rob.
0
 

Author Comment

by:jeffreed
ID: 20298892
Adding the below text worked.  Thanks!!!
</p></body>
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

730 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