Before you start to write VBA code in PowerPoint, you'll want to set up PowerPoint itself and the VBA Editor (also known as the Integrated Development Environment or IDE) correctly. Here's how:
Open a presentation. Press ALT+F11
That'll open the VB edtor in any version of PowerPoint.
OK. Onward.
PPT 2003 and previous: Display the VB Toolbar
The VB Toolbar has buttons to:
PPT 2003 and previous: Security Settings
Note: If you choose Medium, PowerPoint alerts you whenever it opens a presentation that includes VBA code (macros) and lets you choose to enable the code or not.
If you choose Low, PowerPoint enables the code without asking. Bad choice if you get presentations from people you don't know and trust. If there are macros in them, you'll want some warning.
If you choose High or Very High, your code will be disabled. Bad choice if you're writing code.
All versions: Visual Basic Editor (IDE)
Start a new blank presentation. PowerPoint stores VB code in PPT files so it won't let you open the VB Editor unless there's a presentation open. Luckily, the IDE hasn't changed much in 2007/2010 so we can get by from here without all these
Start the VB Editor
Yours will only show one "project" in the Project window on the left instead of the zillions of them you see here. That's normal.
The Editor Format tab contains options for text formatting in the IDE.
The Docking tab has options for the way the various IDE windows dock to one another.
Explore them if you like, but we're not concerned with their settings.
Finally, choose View, Toolbars and put a check next to Edit and Debug. The Edit and Debug toolbars will appear. Drag them by the title bar until they dock under the VB Editor's main menu bar, in the same area as the Standard toolbar. It should look something like this:
But you didn't come here to learn to set up a code editor, you came to learn how to make code, right?
So click Next to move on to the next section and we'll do just that.