<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>North Atlanta Web Design &#187; Internet Explorer</title>
	<atom:link href="http://www.northatlantawebdesign.com/index.php/tag/internet-explorer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.northatlantawebdesign.com</link>
	<description>Programming Examples, Samples, and Tutorials</description>
	<lastBuildDate>Mon, 15 Aug 2011 20:18:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Simple VBScript Progress Bar</title>
		<link>http://www.northatlantawebdesign.com/index.php/2009/07/16/simple-vbscript-progress-bar/</link>
		<comments>http://www.northatlantawebdesign.com/index.php/2009/07/16/simple-vbscript-progress-bar/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 17:26:17 +0000</pubDate>
		<dc:creator>Jeff Gibeau</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Progress Bar]]></category>

		<guid isPermaLink="false">http://www.northatlantawebdesign.com/?p=69</guid>
		<description><![CDATA[Recently I had a need for a simple progress bar written in VBScript to let users know what was going on in a multi-step application. To my surprise, VBScript has nothing built in for a progress bar.  After much searching, I was able to find this thread that linked to yet another thread with a [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>Recently I had a need for a simple progress bar written in <a type="amzn">VBScript</a> to let users know what was going on in a multi-step application.  To my surprise, VBScript has nothing built in for a progress bar.  After much searching, I was able to find <a title="Copy Files with Progress Bar" href="http://www.tek-tips.com/viewthread.cfm?qid=1196550&amp;page=1">this thread</a> that linked to yet <a title="Adding some kind of progress" href="http://www.tek-tips.com/viewthread.cfm?qid=898604">another thread</a> with a simple progress bar done in HTML using InternetExplorer.Application.  I have taken this code and modified it to show an actual progess bar, with percentages, that can be updated as desired.  I&#8217;ve wrapped it up in a nice easy-to-use class for reusability.  Enjoy!</p>
<p><span id="more-69"></span></p>
<div id="attachment_82" class="wp-caption aligncenter" style="width: 322px"><img class="size-full wp-image-82" title="Simple VBScript Progress Bar" src="http://www.northatlantawebdesign.com/wp-content/uploads/2009/07/vbscript_progress_bar.gif" alt="Simple VBScript Progress Bar" width="312" height="99" /><p class="wp-caption-text">Simple VBScript Progress Bar</p></div>
<p>VBScript Progress Bar Class:</p>
<pre class="brush: vb; title: ; notranslate">
Class ProgressBar
Private m_PercentComplete
Private m_CurrentStep
Private m_ProgressBar
Private m_Title
Private m_Text
Private m_StatusBarText

'Initialize defaults
Private Sub ProgessBar_Initialize
m_PercentComplete = 0
m_CurrentStep = 0
m_Title = &quot;Progress&quot;
m_Text = &quot;&quot;
End Sub

Public Function SetTitle(pTitle)
m_Title = pTitle
End Function

Public Function SetText(pText)
m_Text = pText
End Function

Public Function Update(percentComplete)
m_PercentComplete = percentComplete
UpdateProgressBar()
End Function

Public Function Show()
Set m_ProgressBar = CreateObject(&quot;InternetExplorer.Application&quot;)
'in code, the colon acts as a line feed
m_ProgressBar.navigate2 &quot;about:blank&quot; : m_ProgressBar.width = 315 : m_ProgressBar.height = 40 : m_ProgressBar.toolbar = false : m_ProgressBar.menubar = false : m_ProgressBar.statusbar = false : m_ProgressBar.visible = True
m_ProgressBar.document.write &quot;&lt;body Scroll=no style='margin:0px;padding:0px;'&gt;&lt;div style='text-align:center;'&gt;&lt;span name='pc' id='pc'&gt;0&lt;/span&gt;&lt;/div&gt;&quot;
m_ProgressBar.document.write &quot;&lt;div id='statusbar' name='statusbar' style='border:1px solid blue;line-height:10px;height:10px;color:blue;'&gt;&lt;/div&gt;&quot;
m_ProgressBar.document.write &quot;&lt;div style='text-align:center'&gt;&lt;span id='text' name='text'&gt;&lt;/span&gt;&lt;/div&gt;&quot;
End Function

Public Function Close()
m_ProgressBar.quit
m_ProgressBar = Nothing
End Function

Private Function UpdateProgressBar()
If m_PercentComplete = 0 Then
m_StatusBarText = &quot;&quot;
End If
For n = m_CurrentStep to m_PercentComplete - 1
m_StatusBarText = m_StatusBarText &amp; &quot;|&quot;
m_ProgressBar.Document.GetElementById(&quot;statusbar&quot;).InnerHtml = m_StatusBarText
m_ProgressBar.Document.title = n &amp; &quot;% Complete : &quot; &amp; m_Title
m_ProgressBar.Document.GetElementById(&quot;pc&quot;).InnerHtml = n &amp; &quot;% Complete : &quot; &amp; m_Title
wscript.sleep 10
Next
m_ProgressBar.Document.GetElementById(&quot;statusbar&quot;).InnerHtml = m_StatusBarText
m_ProgressBar.Document.title = m_PercentComplete &amp; &quot;% Complete : &quot; &amp; m_Title
m_ProgressBar.Document.GetElementById(&quot;pc&quot;).InnerHtml = m_PercentComplete &amp; &quot;% Complete : &quot; &amp; m_Title
m_ProgressBar.Document.GetElementById(&quot;text&quot;).InnerHtml = m_Text
m_CurrentStep = m_PercentComplete
End Function

End Class
</pre>
<p>Example of Usage:</p>
<pre class="brush: vb; title: ; notranslate">
'Declare progressbar and percentage complete
Dim pb
Dim percentComplete
'Setup the initial progress bar
Set pb = New ProgressBar
percentComplete = 0
pb.SetTitle(&quot;Step 1 of 5&quot;)
pb.SetText(&quot;Copying bin/Debug Folder&quot;)
pb.Show()

'Loop to update the percent complete of the progress bar
'Just add the pb.Update in your code to update the bar
'Text can be updated as well by pb.SetText
Do While percentComplete &lt;= 100
wscript.sleep 500
pb.Update(percentComplete)
percentComplete = percentComplete + 10
Loop
wscript.sleep 3000

'This shows how you can use the code for multiple steps
'In a future iteration I will add a second bar to measure overall progress
percentComplete = 0
pb.SetTitle(&quot;Step 2 of 5&quot;)
pb.SetText(&quot;Copying bin/Release Folder&quot;)
pb.Update(percentComplete)
Do While percentComplete &lt;= 100
wscript.sleep 500
pb.Update(percentComplete)
percentComplete = percentComplete + 10
Loop
pb.Close()
wscript.quit
</pre>
<p>In a future release, I may add another progress bar to keep track of the steps that are completed.  Feel free to use and modify this code as you desire.</p>
<p>Useful Links:</p>
<ul>
<li><a title="Microsoft VBScript Reference" href="http://msdn.microsoft.com/en-us/library/d1wf56tt%28VS.85%29.aspx">Microsoft VBScript Reference</a></li>
<li><a title="W3Schools VBScript Reference" href="http://www.w3schools.com/Vbscript/default.asp">W3Schools VBScript Reference</a></li>
<li><a title="Copy Files with a Progress Bar" href="http://www.tek-tips.com/viewthread.cfm?qid=1196550&amp;page=1">Copy Files with a Progress Bar</a></li>
</ul>
<!-- sphereit end --><span style="margin-bottom:40px; border-bottom:none;"><a class="iconsphere" title="Sphere: Related Content" onclick="return Sphere.Widget.search('http://www.northatlantawebdesign.com/index.php/2009/07/16/simple-vbscript-progress-bar/')" href="http://www.sphere.com/search?q=sphereit:http://www.northatlantawebdesign.com/index.php/2009/07/16/simple-vbscript-progress-bar/">Sphere: Related Content</a></span><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.northatlantawebdesign.com/index.php/2009/07/16/simple-vbscript-progress-bar/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

