Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Use an Internet Explorer Window to Display Information from your VB Scripts

0.00/5 (No votes)
17 Aug 2007 1  
This class allows you to display all types of static and dynamic information gathered in a VB Script using an Internet Explorer Window.

Introduction

Time and time again for my job I needed to be able to display dynamic/updating information about our PACS system. Using a VB Script and this class, I was able to create the example below. This example would gather information from our database every 15 seconds and then update the Window. Since then I have found so many other uses for this class. So I thought I would share it with everyone.

Screenshot - Sample.jpg

Background

This article explains how to use the IEDisplay class, and does not go into the functioning of the class code itself.

Using the code

First you need to copy the contents of the class located in the file IEDisplay_Class_Only.txt and paste it in your VB Script.

The next thing is to create an instance of the class in your VB Script:

// 'Create our IE window to output info from our script to

Dim ScriptUpdateWindow
Set ScriptUpdateWindow = new IEDisplay

Then set the four properties BEFORE calling the .Show method:

ScriptUpdateWindow.WindowTitle = "Jake's IE Display Class" 'Default is blank

ScriptUpdateWindow.InitialText = "Loading Please wait..." 'Default is blank

ScriptUpdateWindow.NumberOfLabels = 2 'default of 1, max of 5

ScriptUpdateWindow.Horizontal_Vertical_Labels = _
                            "vertical" 'default of "horizontal"

Now call the .show method and the Window is available to display information to:

'Call the .show method to make the IE window appear

ScriptUpdateWindow.Show()

There are two ways to add data to the IE window. Using the .SetText or .AppendText methods.

ScriptUpdateWindow.SetText "StringText Set To Display In Label",_
                                1 '(The label Number)

ScriptUpdateWindow.AppendText "StringText Set To Append In Label" + _
                                IP,1 '(The label Number)

Points of Interest

See the VBScript examples provided with the zip file. These examples show all of the available methods of the class and how to use all the features. The comments through the code should answer any questions on how to use this properly.

History

  • Version 1.0: Submitted on 17-Aug-2007

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here