Microsoft KB Archive/314811

= HOW TO: Create a DHTML Slide Show Page by Using Windows Script Host =

Article ID: 314811

Article Last Modified on 3/20/2004

-

APPLIES TO


 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q314811



IN THIS TASK
SUMMARY
 * Step 1: Create the WSH Sample
 * Step 2: Create the Slide Show

REFERENCES



SUMMARY
This article describes how to use sample Windows Script Host (WSH) code to programmatically create a DHTML slide show in a folder that contains images.

NOTE: This article uses custom DHTML that may not be available in all browsers.

back to top

Step 1: Create the WSH Sample
NOTE: Because there are several versions of Microsoft Windows, the following steps may be different on your computer. If they are, see your product documentation to complete these steps.

 Click Start, point to Programs, point to Accessories, and then click Notepad.  Type or paste the following WSH code into Notepad: Option Explicit

' slideshow delay in milliseconds Const lngDelay = 2000

' valid file extensions for slides Const strValid = &quot;.jpg.jpeg.gif.png&quot;

' output file name Const strFileName = &quot;slideshow.htm&quot;

' ******************** DO NOT MODIFY BELOW THIS LINE ********************

' Define variables. Dim objFSO Dim objOutput Dim strImage Dim strExt Dim strFirst Dim lngCount Dim objFolder Dim objFile

' Create the output file. Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;) Set objOutput = objFSO.CreateTextFile(strFileName)

' Output the page header and beginning of slideshow script. objOutput.WriteLine &quot; &quot; & vbCrLf & &quot; &quot; objOutput.WriteLine &quot;&quot; & vbCrLf & &quot;&quot; & vbCrLf & &quot; &quot; .WriteLine &quot; &quot; & vbCrLf & &quot;&quot; .WriteLine &quot; Please wait... &quot; .WriteLine &quot;Loading &quot; & lngCount & &quot; images... (0 ) &quot; .WriteLine &quot; &quot; & vbCrLf & &quot; &quot; End With

' Close the output file. objOutput.Close  Save the file to your desktop as Slideshow.vbs .

back to top

Step 2: Create the Slide Show

 * 1) Copy the Slideshow.vbs script to a folder that contains images (for example, to your My Documents\My Pictures folder).
 * 2) Double-click the script to run it.

When the script is finished running, you will have a file named Slideshow.htm, which contains the DHTML script for the slide show.

back to top

