Kamis, 29 November 2012

How to Use VBA in PowerPoint translate


Instructions

    • 1
      Launch the PowerPoint 2010 program. Bring up an existing presentation or start a new one.
    • 2
      Click on the "File" tab at the top of the screen and choose "Options" from the list that appears. Select "Customize Ribbon" from the left side of the Options window. Find the "Developer" listing on the far right column and click the box next to it to add a check mark. Click "OK."
    • 3
      Click the new "Developer" tab at the top of the screen. Click the "Macro Security" button and select "Enable all Macros." Click "OK."
    • 4
      Click the "Macros" button in the ribbon. Enter a name for the macro and click "Create." The Visual Basic Console launches, with your blank macro on the right side of the console. The "Sub" and "End Sub" commands signify the beginning and the end of your macro.
    • 5
      Place your cursor into the line between the "Sub" and "End Sub" commands. Type in the variables that you want to use using the format of "Dim x as y", where "x" is your variable name and "y" is that type of variable. You can enter as many variables as you want. If you need to use a variable across multiple macros, just enter it above the "sub" line instead of below it.
    • 6
      Press "Enter" to create a new blank line between "Sub" and "End Sub." Type in the code for your macro. VBA is a fairly robust language with numerous coding options. Because most PowerPoint macros want to interact with the presentation in some way, be sure to use the PowerPoint Object Model Reference to find out what PowerPoint VBA calls the different areas, objects and button in the PowerPoint presentation.
    • 7
      Click the "X" in the top-right corner of the VBA console once you are done with your macro. If you need to bring it back up again, click the "Visual Basic" button on the "Developer" tab, or just press "Alt" and "F11."
    • 8
      Press the "Macros" button to bring up the Macro window. Select the macro that you just created and click "Run" to run it.
    • 9
      Click the "File" tab when you are ready to save your presentation. For security reasons, PowerPoint does not let you save a presentation with a macro as a .pptx file, so save it as a .pptm file instead. Click "Save As," then click the drop-down box in the "Save As" window, choose "PowerPoint Macro-Enabled Presentation" and click "Save."


Read more: How to Use VBA in PowerPoint | eHow.com http://www.ehow.com/how_8641560_use-vba-powerpoint.html#ixzz2DbKOCtMN

Tidak ada komentar:

Posting Komentar