PPT97: Main Street Demo Uses VBA for Interactive Slide Show

Last reviewed: March 9, 1998
Article ID: Q166176
The information in this article applies to:
  • Microsoft PowerPoint 97 for Windows

SUMMARY

The Main Street Market Demo demonstrates some of the capabilities of PowerPoint 97 and Microsoft Visual Basic for Applications. Much of the functionality of the presentation is archived through Visual Basic for Applications macro code. This Demo is available to download from the Microsoft Software Library (MSL):

 ~ maindemo.exe (size: 306269 bytes) 
                 299 KB self-extracting file

When you run this file, you must use the -d switch to decompress the folder structure. For example, at the MS-DOS command prompt, type the following command:

   maindemo -d

This self-extracting file contains the following files:

   Demo.pps
   Items.mdb
   ReadMe.txt
   Blender.wmf
   Camcord.wmf
   Camera5.wmf
   Circus.wmf
   Clock.wmf
   Frnknstn.wmf
   Goggles.wmf
   Knife1.wmf
   Mousepad.wmf
   Needle.wmf
   Pliers.wmf
   Space.wmf
   Tree.wmf
   Videocas.wmf

NOTE: This demo is not designed to run in PowerPoint 98 Macintosh Edition.

MORE INFORMATION

The following information is the complete text of the Readme.txt file:

   -------------------------------------------------------------
   Microsoft Main Street Market Demo for Microsoft PowerPoint 97
                              March l997
   -------------------------------------------------------------
             (c) Copyright Microsoft Corporation, 1997

CONTENTS

  • SYSTEM REQUIRMENTS
  • ABOUT THE MAIN STREET MARKET DEMO
  • HOW TO USE THE MAIN STREET MARKET DEMO
  • THE MAIN STREET MARKET CODE
  • THE CATALOG DATABASE (ITEMS.MDB)
  • KNOWN ISSUES
  • HOW TO REMOVE THE MAIN STREET MARKET DEMO

SYSTEM REQUIRMENTS

The Main Street Market Demo requires that you have the following components installed and running correctly:

   Microsoft PowerPoint 97
   Microsoft Jet Database Engine Version 3.5

Both of these components are provided with Microsoft Office 97.

Use the following steps to verify that the Microsoft Jet Database Engine is installed:

  1. In Windows Explorer, open the c:\Program Files folder.

  2. Open the Microsoft Shared folder.

  3. If you see a folder called DAO, then you probably have the Microsoft Jet Engine installed.

    NOTE: If you do not see the DAO folder, install Microsoft Jet to run this demo. For more information on installing a single component, please see the following article in the Microsoft Knowledge Base:

          ARTICLE-ID: Q120802
    
          TITLE     : Office: How to Add/Remove a Single Office
                      Program or Component
    
    

ABOUT THE MAIN STREET MARKET DEMO

The Main Street Market Demo demonstrates some of the capabilities of PowerPoint 97 and Visual Basic for Applications. Much of the functionality of the presentation is archived through Visual Basic for Applications macro code.

The Main Street Market Demo creates slides "on the fly" based on choices you make during the presentation. For example, at the beginning of the presentation you are asked to enter your name. From that point, dialogs and certain slides are modified to reflect your name. This technique allows you to personalize and customize the viewing experience.

The Demo creates a catalog of products sold by the fictitious company, Main Street Market. The catalog is created during run-time based on information in an Access database. You can modify the database to include different products. For more information, please see "The Catalog Database (Items.mdb)" section of this article.

In the presentation, you can mark items you want to purchase. The items are added to your shopping cart. You can remove or delete items from the shopping cart. You can also view the contents of the shopping cart as long as the shopping cart contains at least one item. And, finally, you can purchase the items in the shopping cart.

HOW TO USE THE MAIN STREET MARKET DEMO

Getting Started

  1. Locate the Demo.pps file on your hard disk.

  2. Double-click the Demo.pps file.

    Because the file has a .pps extension, PowerPoint will automatically start the presentation in Slide Show mode. The first slide you see is the Main Street Market logo.

  3. To run the slide show, click anywhere on this slide.

  4. Type your name in the Name box, and then press ENTER.

    A slide appears asking you if the name you typed is correct. Click Yes to advance to the next slide. Click No to return to the previous slide.

Welcome Slide

From the Welcome slide you can view one of three catalogs: clothing, electronics, and hardware. To select the catalog, click the name or the circle to the left of the catalog you want to view. You can select multiple catalogs. When you select a catalog a check mark appears in the circle to the left of the catalog name. When you have selected the catalogs you want to view, click Next.

The presentation creates the catalog using information that is stored in an Access database (.mdb) file.

NOTE: The first time you create a catalog, it may take a moment. However, the next time you create a catalog, within the same slide show, the catalog will be created more quickly.

Catalog Slides

The catalog slides show one product at a time. One slide is displayed for each item in the catalog.

The following options are available when you view a product:

Add To Cart    Adds the current product to your shopping cart.

View Cart      Displays the contents of the shopping cart, as long as
               there is at least one item in the shopping cart.

Previous       Goes back to the previous product in the catalog.

Next           Goes to the next product in the catalog.

Start Over     Rebuilds the product catalog.

Shopping Chart

The Shopping Cart slide displays the items you selected from the catalog. To view the Shopping Cart slide, click the View Cart icon that appears on any catalog slide. You can make the following selections on the Shopping Cart slide:

Remove Item     Removes the item from the shopping cart and updates the
                list of products.

Previous        Returns you to the catalog slide where you clicked
                View Cart.

Buy Now!        Purchases the items currently held in your shopping
                cart and then returns you to the Main Street Market
                splash screen.

Start Over      Rebuilds the product catalog.

Exiting the Demo

To exit the Main Street Market presentation at any time, press ESC. If you receive a message asking if you want to save changes to Demo.pps, click No. This message is displayed because you are adding slides to the slide show during run-time. You do not need to save these changes.

THE MAIN STREET MARKET CODE

Microsoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

The Visual Basic procedures in this demo are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support engineers can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs.

If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.

The Main Street Market demo is controlled by Visual Basic for Applications code. If you are interested in how the demo was created, use the following steps to view the Main Street Market demo code:

  1. Open the Demo.pps file in PowerPoint 97.

    If you receive a warning message asking if you want to enable the macros, click Enable Macros.

  2. On the Tools Menu, point to Macro, and then click Visual Basic Editor.

  3. In the Project Explorer Window you should see code similar to the following:

          VBAProject(Demo.pps)
          --------------------
    

             Microsoft PowerPoint Objects
             ----------------------------
    
                Slide2
                Slide3
                Slide5
                SlideMaster
    
             Modules
             -------
    
                ButtonCode
                DaoCode
                InitSlideCode
                ShoppingCart
                Tools
    
             Class Modules
             -------------
    
                Customer
    
       The underlined items in the preceding list act like folders. You can
       expand or compress the folders by clicking the + or - symbol to the
       left of the item.
    
       To view the code, double-click the module, class module, or
       PowerPoint object you want to view.  For example, to view the code
       in the ShoppingCart module:
    
       a. Expand the VBAProject (Demo.pps) folder.
    
       b. Expand the Modules folder.
    
       c. Double-click the ShoppingCart module.
    
          The code for the Shopping Cart module is displayed in the code
          window.
    
    

THE CATALOG DATABASE (ITEMS.MDB)

The catalog is contained in an Access 97 database (.mdb) file. You can edit the Items.mdb file in Access 97 if you want to modify the images, descriptions, or prices that are displayed when you run the Main Street Market demo:

  1. Start Microsoft Access 97.

  2. Open the Items.mdb file.

  3. Click the Tables tab.

  4. Open the InventoryList table.

  5. Make the changes you want to the table.

    The following table identifies the fields used in the InventoryList table in the Items.mdb database. You can add or delete items from any of these categories:

       Product Name     Stores the name of the product.
    
       Description      Holds the description of the product.
    
       Price            Holds the price of the product.
    
       Shipping         Holds the shipping cost of the product.
    
       Picture          Holds the path to the graphic that you want to use
                        to represent the product.
    
                        NOTE: The graphic must be in a format for which
                        PowerPoint has a graphic filter. You can use a
                        relative path to the graphic or place the graphic
                        in the same directory as the presentation.
    
       Category         Defines the catalog name, such as Hardware,
                        Clothing, or Electronics.
    
                        NOTE: If you want to define a new catalog, you must
                        also modify the Visual Basic code.
    
       Layout           Specifies the layout for the catalog slides. This
                        value should be 13.
    
                        NOTE: If you want to use a different layout, you
                        must modify the Visual Basic code.
    
    

  6. Click Save on the File menu.

KNOWN ISSUES

The following is a list of the known issues with the Main Street Market demo.

  • If you specify an invalid path to a graphic file in the Items.mdb file, the Main Street Market demo is unable to create a catalog.
  • When you exit from the demo, you receive a message asking if you want to save changes to the Demo.pps file. This occurs because the demo creates slides that are not part of the original Demo.pps file. Microsoft recommends that you do not save the changes to the file because this will increase the size of the Demo.pps file.
  • If you run Demo.pps from a server, you must have read, write, and create permissions to the server where the demo resides. If you do not, the demo cannot create the catalog.

HOW TO REMOVE THE MAIN STREET MARKET DEMO

To remove the Main Street Market demo, delete the following files which are installed by the Main Street demo program:

   Demo.pps
   Items.mdb
   Blender.wmf
   Camcord.wmf
   Camera5.wmf
   Circus.wmf
   Clock.wmf
   Frnknstn.wmf
   Goggles.wmf
   Knife1.wmf
   Mousepad.wmf
   Needle.wmf
   Pliers.wmf
   Space.wmf
   Tree.wmf
   Videocas.wmf


Additional query words:
Keywords : kbcode kbmacro kbprg kbreadme kbdta kbdtacode kbpptvba kbfile
Version : WINDOWS:97
Platform : WINDOWS
Hardware : x86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 9, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.