internet.com
You are in the: Small Business Computing Channelarrow
Small Business Technology
» ECommerce-Guide | Small Business Computing | Webopedia | WinPlanet

WinPlanet Software Downloads and Reviews for Small Businesses
Search
Power Search | Tips
-
Navigate WinPlanet
WinPlanet Home Page

Software
Download Index
In-Depth Reviews
Tips & Tutorials
Updates
News

Software Categories
Browsers
Chat / Conferencing
Desktop Utilities
Development
Internet Apps
Multimedia
OS Service Packs
Productivity Tools

Software Glossary

WinPlanet Newsletter

internet.commerce
Partners & Affiliates













Small Business Computing
Small Business Computing
Ecommerce Guide
Webopedia
WinPlanet

WinPlanet / Reviews

Download of the day
Adobe Flash Player

Most Popular Software Downloads
Windows Vista Service Pack 2 (Vista SP2)
Mozilla Firefox 3
QuickTime for Windows
Adobe Flash Player
Windows 7
Norton Internet Security 2010
Internet Explorer 8
CCleaner (Crap Cleaner)
Winamp
Skype

Most Popular Software Articles
Windows Vista Tips: Home Networking Setup Tutorial
10 Must-Have Apps: The Free Windows Networking Toolkit
How to Make Your Internet Connection Faster, Better


Software Reviews

Exploring Office 2007: Create Your Own Feedback Quiz in PowerPoint 2007
Using ActiveX Controls in PowerPoint to Gather Info
Helen Bradley

Not all PowerPoint presentations are meant to be viewed in front of a large audience. Many presentations are designed for individual viewing at the user's leisure.

When you're creating a single user PowerPoint presentation and when you need to gather information from that user you can do it using ActiveX controls. In this article, I'll show you how to do this in PowerPoint 2007.

» Display the Developer Tab

To start you need to display the PowerPoint Developer tab on the Ribbon. Click the Office button, choose PowerPoint Options > Popular and enable the Show Developer tab in the Ribbon checkbox and click OK. The Developer tab provides access to the ActiveX controls central to this solution.

» Create the Form Objects

Now add a new slide to your presentation — choose one with only the title and no placeholders. Click the Developer tab, click the Label (ActiveX Control), and drag to create a Label on the slide.

Right click the Label, choose Properties, and in the properties dialog locate the Caption property and set it to read "Your Name:" (without the quote marks). The caption will appear in the label on the slide. Size the label just large enough to display its text.

You'll use a textbox for the user to type their name, so click the Text Box (ActiveX Control) on the tab and drag a textbox onto the slide. You can now add another label and textbox combination. This time set the Label's caption property to Email Address. You can continue to add more labels and textboxes for any other information that you want to retrieve from your user.

To format the Labels and Textboxes, click on each in turn and, from the Properties dialog, click in the Font area and double-click the ellipsis button to open the Font dialog to change the font of that object.

Finish the project by clicking the Command Button (ActiveX Control) and click and drag a button onto your form. Change the button's Caption property to read Submit.

» Create the Code

You need some code to take the answers from the objects on the slide and to write them to a text file on disk. To do this, double-click the Submit button to open the Visual Basic Editor in the CommandButton1_Click event area.

Type the code below — the Sub… and End Sub statements will already be in place on the screen:

Private Sub CommandButton1_Click()
    Dim myanswer As String
  
    'Open or create file for the user information
    Open ActivePresentation.Path & "\info.txt" For Append As #1
    'send the name entered to the text file
    myanswer = "Name: " & TextBox1.Text
    Print #1, myanswer
    'send the email address entered to the text file
    myanswer = "Email address: " & TextBox2.Text
    Print #1, myanswer
    'add a blank line to the file
    myanswer = ""
    Print #1, myanswer
    Close #1

    'Tell the user that the information has been recorded
    MsgBox "Your information has been recorded, thank you!"

    'Clear the entries in the form
    TextBox1.Text = ""
    TextBox2.Text = ""

    'Move to next slide
    SlideShowWindows(1).View.Next
End Sub

In this example, I have included code for just the two textboxes: TextBox1 and TextBox2. If you want to add more textboxes you can add code for them following the general pattern of the code above.

The code includes a message box (MsgBox), which appears to confirm that the information has been submitted. After that the contents of the textboxes will be cleared again, reassuring the user that the information has been "sent." The presentation then moves forward to the next slide.

The lines that are prefixed with a single apostrophe are comments and are not executable code. They will help you understand what's happening at each point in the program.

| Next Page »

Contents:
1. Using ActiveX Controls in PowerPoint to Gather Info
2. Testing the Form and Extending the Application




internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs