What Are Macros?


Macros are added code that can repeat or automate tasks within another program. Think of them as a translation of what you want PowerPoint to do into a language the computer can understand. The code used to create macros for PowerPoint is written in Visual Basic for Applications, or VBA. The VBA commands available for PowerPoint are referred to as the PowerPoint object model.

Macros are very useful little toys. They can run while designing and editing a presentation or they can run while the presentation is being displayed.

Macros that run while in edit mode reduce the tedium in creating the presentation by making it easier to do certain tasks such as the changes Larry needs to make to modify his presentations for the potential clients . Rather than editing each slide by hand, he is going to build a series of macros allowing PowerPoint to ask him what to change and then make the changes for him.

Macros that run during a presentation allow slide elements to turn on and off, change slide elements, get text or other input from the participants , or record data about the presentations.

More extensive macros perform complex tasks easily. Some of the most requested macros can be found in the PPT FAQ, as well as on the sites run by PowerPoint MVPs Shyam Pillai and Chirag Dalal. URLs for these sites can be found in Appendix A, Where to Find More Help.

While there is not a single book on VBA for PowerPoint, you can find some information in the PowerPoint help sections on macro creation and the VBA language. There are also several good VBA resources on-line which are also listed in Appendix A. You can learn a lot about VBA and macros by recording and customizing your own macros.

My best suggestion for learning to use macros is to read and join the PowerPoint newsgroup (see Appendix A for information on accessing it). Questions are posted daily on how to make various macros work. If you are having a coding problem, feel free to post it to the group . Tell us what PowerPoint version you are using, what you are trying to do, what is happening, and what the code is you have already written. The more details you give, the more likely you are to get quick help.

PowerPoint macros can be created by either recording functionality or by using the Visual Basic Editor. In most cases, you will start by recording the basic process you wish to automate and then adjust the resulting code to do exactly what you want, when you want.

Why adjust the code? Because when you record a macro, you record an exact set of steps. PowerPoint doesn't know you really meant to record a process. You generally will need to edit your macros to tailor them to your specific situations.

As your VB skills expand, you will be able to create macros from scratch in the VB editor. This skill set is beyond the scope of this book. We will touch on it at the end of this chapter so you have resources to use for more advanced macro work.

start sidebar
Tip 50: Save your work!

Every time you get ready to run or record a macro which is in development, save the presentation file. It is also a good idea to use new file names for these temporary copies.

end sidebar
 

Macro Process

The basic process Larry went through to create his macro has seven steps:

  1. Plan what the macro needs to do

  2. Record, edit and test each basic macro

  3. Create a toolbar with buttons to run each macro individually

  4. To make it easier to run the series of macros, create a routine that will call each macro in turn

  5. Add a toolbar button to run the full process macro

  6. Change the macro to an add-in

  7. Distribute the add-in




Kathy Jacobs On PowerPoint
Kathy Jacobs On PowerPoint
ISBN: 972425861
EAN: N/A
Year: 2003
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net