Successfully reported this slideshow.
PowerPoint Project 5 Working with Macros and Visual Basic  for Applications (VBA)
Creating a Custom Toolbar <ul><li>Click Tools on the menu bar and then point to Customize </li></ul><ul><li>Click Customiz...
Creating a Custom Toolbar <ul><li>When the New Toolbar dialog box appears, type  Mine  in the Toolbar name text box </li><...
Adding Two Buttons  to the Your Toolbar <ul><li>Click the Toolbar Options button on the Mine toolbar </li></ul><ul><li>Poi...
Adding Two Buttons  to the Your Toolbar <ul><li>Drag the Save as Web Page command from the Commands list to the new Vacati...
Adding Two Buttons  to the Your Toolbar <ul><li>Select Tools for the category and Search as the command. Drag it to your t...
Adding Two Buttons  to the Your Toolbar
Recording a Macro <ul><li>Open a blank presentation </li></ul><ul><li>Add two slides </li></ul><ul><li>Click Tools on the ...
Recording a Macro <ul><li>When the Record Macro dialog box is displayed, type  </li></ul><ul><li>ChangeDesignTemplate in t...
Recording a Macro <ul><li>Click the Color/grayscale box arrow and then click Pure Black and White </li></ul><ul><li>Click ...
Recording a Macro <ul><li>With the macro recording, change the design template. </li></ul><ul><li>Point to the Stop Record...
Editing a Macro <ul><li>Click Tools on the menu bar, point to Macro, and then point to Visual Basic Editor </li></ul><ul><...
Opening the Visual Basic IDE  and a New Form <ul><li>Click Tools on the menu bar, point to Macro, and then point to Visual...
Opening the Visual Basic IDE  and a New Form <ul><li>Click Tools and got to Macros </li></ul><ul><li>Click on Visual Basic...
Opening the Visual Basic IDE  and a New Form <ul><li>Click Insert UserForm – second icon on toolbar. To the right of the P...
Opening the Visual Basic IDE  and a New Form
Changing the Form Size  and the Toolbox Location <ul><li>Without releasing the mouse button, drag the form window’s bottom...
Changing the Form Size  and the Toolbox Location
Adding Label and Combo Box Controls to a Form <ul><li>Click the Label button in the Toolbox- Looks like a big A </li></ul>...
Adding Label and Combo Box Controls to a Form <ul><li>Position the mouse pointer below the Label1 control </li></ul><ul><l...
Adding Label and Combo Box Controls to a Form
Setting the Controls’  Caption Properties <ul><li>Click the Label1 control </li></ul><ul><li>With the Label1 control selec...
Adding Command Button Controls to a Form <ul><li>Click the CommandButton button in the Toolbox – the last button on the se...
Adding Command Button Controls to a Form
Adding Command Button Controls to a Form  <ul><li>Click the command button. In the  Properties  window, change the code na...
Adding Command Button Controls to a Form  <ul><li>Add a statement to the CmdSendOrder_Click procedure to display a simple ...
Adding Command Button Controls to a Form  <ul><li>Run the dialog box to see the results.  </li></ul><ul><li>Hit Run then c...
Adding Command Button Controls to a Form <ul><li>Let’s go to the next Command button </li></ul><ul><li>Name it Finish </li...
Adding Command Button Controls to a Form <ul><li>To see the events for a different control on the same UserForm or for the...
Adding Command Button Controls to a Form <ul><li>We are going to select Click </li></ul><ul><li>And type in </li></ul><ul>...
Entering the Create Presentation Procedure
PowerPoint Project 5 Complete
Upcoming SlideShare
Loading in …5
×

Power Point Project 5

1,694 views

Published on

  • Be the first to comment

Power Point Project 5

  1. 1. PowerPoint Project 5 Working with Macros and Visual Basic for Applications (VBA)
  2. 2. Creating a Custom Toolbar <ul><li>Click Tools on the menu bar and then point to Customize </li></ul><ul><li>Click Customize </li></ul><ul><li>If necessary, when the Customize dialog box appears, click the Toolbars tab </li></ul><ul><li>Click the New button </li></ul>
  3. 3. Creating a Custom Toolbar <ul><li>When the New Toolbar dialog box appears, type Mine in the Toolbar name text box </li></ul><ul><li>Click the OK button </li></ul><ul><li>Click the Close button in the Customize dialog box </li></ul>
  4. 4. Adding Two Buttons to the Your Toolbar <ul><li>Click the Toolbar Options button on the Mine toolbar </li></ul><ul><li>Point to Add or Remove Buttons, and then point to Customize on the Add or Remove Buttons submenu </li></ul><ul><li>Click Customize </li></ul><ul><li>When the Customize dialog box is displayed, click the Commands tab </li></ul><ul><li>Scroll down in the Commands list and then click Save as Web Page </li></ul>
  5. 5. Adding Two Buttons to the Your Toolbar <ul><li>Drag the Save as Web Page command from the Commands list to the new Vacation toolbar </li></ul><ul><li>Select another category and a new Command. Drag it to your toolbar. </li></ul><ul><li>Select another category and a new Command. Drag it to your toolbar. </li></ul><ul><li>Select Tools for the category and Search as the command. Drag it to your toolbar. Click the Modify Selection button and then point to Change Button Image </li></ul><ul><li>Change the When the Change Button Image palette is displayed, point to another button. </li></ul>
  6. 6. Adding Two Buttons to the Your Toolbar <ul><li>Select Tools for the category and Search as the command. Drag it to your toolbar. Click the Modify Selection button and then point to Change Button Image </li></ul><ul><li>Change the When the Change Button Image palette is displayed, point to another button. </li></ul><ul><li>Click the Close button in the Customize dialog box </li></ul>
  7. 7. Adding Two Buttons to the Your Toolbar
  8. 8. Recording a Macro <ul><li>Open a blank presentation </li></ul><ul><li>Add two slides </li></ul><ul><li>Click Tools on the menu bar, point to Macro, and then point to Record New Macro on the Macro submenu </li></ul><ul><li>Click Record New Macro </li></ul>
  9. 9. Recording a Macro <ul><li>When the Record Macro dialog box is displayed, type </li></ul><ul><li>ChangeDesignTemplate in the Macro name text box </li></ul><ul><li>Type Changes Design Template in the Description text box </li></ul>
  10. 10. Recording a Macro <ul><li>Click the Color/grayscale box arrow and then click Pure Black and White </li></ul><ul><li>Click the OK button </li></ul><ul><li>Click File on the menu bar and then click Print </li></ul><ul><li>When the Print dialog box is displayed, click the Color/grayscale box arrow and then click Grayscale (or your computer’s default print option) </li></ul><ul><li>Click the Slides per page box arrow in the Handouts area and then click 6 </li></ul>
  11. 11. Recording a Macro <ul><li>With the macro recording, change the design template. </li></ul><ul><li>Point to the Stop Recording button </li></ul><ul><li>Click the Stop Recording button </li></ul>
  12. 12. Editing a Macro <ul><li>Click Tools on the menu bar, point to Macro, and then point to Visual Basic Editor </li></ul><ul><li>Click Visual Basic Editor </li></ul><ul><li>Click on the ChangeDesignTemplate </li></ul><ul><li>You have just written your first Visual Basic </li></ul><ul><li>Your assignment is to play with this today and record other macros </li></ul><ul><li>From File, hit Close and Return to PowerPoint </li></ul>
  13. 13. Opening the Visual Basic IDE and a New Form <ul><li>Click Tools on the menu bar, point to Macro, and then point to Visual Basic Editor </li></ul><ul><li>Click Visual Basic Editor </li></ul><ul><li>Click on the ChangeDesignTemplate </li></ul><ul><li>You have just written your first Visual Basic </li></ul><ul><li>Your assignment is to play with this today and record other macros </li></ul>
  14. 14. Opening the Visual Basic IDE and a New Form <ul><li>Click Tools and got to Macros </li></ul><ul><li>Click on Visual Basic Editor </li></ul>
  15. 15. Opening the Visual Basic IDE and a New Form <ul><li>Click Insert UserForm – second icon on toolbar. To the right of the PowerPoint icon </li></ul><ul><li>If the Toolbox does not display, click the Toolbox button on the Standard toolbar </li></ul>
  16. 16. Opening the Visual Basic IDE and a New Form
  17. 17. Changing the Form Size and the Toolbox Location <ul><li>Without releasing the mouse button, drag the form window’s bottom border down </li></ul><ul><li>Release the mouse button </li></ul><ul><li>Without releasing the mouse button, drag the form’s bottom-center sizing handle down </li></ul><ul><li>Release the mouse button </li></ul><ul><li>Click the Toolbox title bar and drag it to the lower-right side of the form window </li></ul>
  18. 18. Changing the Form Size and the Toolbox Location
  19. 19. Adding Label and Combo Box Controls to a Form <ul><li>Click the Label button in the Toolbox- Looks like a big A </li></ul><ul><li>Position the mouse pointer in the upper-left corner of the form </li></ul><ul><li>Click the mouse button </li></ul><ul><li>Click the ComboBox button in the Toolbox – the third icon on the top row </li></ul>
  20. 20. Adding Label and Combo Box Controls to a Form <ul><li>Position the mouse pointer below the Label1 control </li></ul><ul><li>Click the mouse button </li></ul>
  21. 21. Adding Label and Combo Box Controls to a Form
  22. 22. Setting the Controls’ Caption Properties <ul><li>Click the Label1 control </li></ul><ul><li>With the Label1 control selected, click Caption on the Alphabetic tab in the Properties window </li></ul><ul><li>If the Properties window is not visible, click View and Properties Window </li></ul><ul><li>Double-click the current caption, Label1, to select it, type Add a background as the caption, and then press the ENTER key </li></ul>
  23. 23. Adding Command Button Controls to a Form <ul><li>Click the CommandButton button in the Toolbox – the last button on the second row </li></ul><ul><li>Position the mouse pointer in the lower-left corner of the form </li></ul><ul><li>Click the mouse button </li></ul><ul><li>Repeat the previous steps to add a second CommandButton control, CommandButton2, as shown on the following slide </li></ul>
  24. 24. Adding Command Button Controls to a Form
  25. 25. Adding Command Button Controls to a Form <ul><li>Click the command button. In the Properties window, change the code name of the command button by typing CmdSendOrder in the space to the right of (Name) . </li></ul><ul><li>Double­click the command button to view the code associated with it. By default, the Click event procedure will be displayed in the Code window. </li></ul>
  26. 26. Adding Command Button Controls to a Form <ul><li>Add a statement to the CmdSendOrder_Click procedure to display a simple message box (use the following example). </li></ul><ul><ul><li>Private Sub ComandButton1_Click()    </li></ul></ul><ul><ul><li>  MsgBox &quot;I've been clicked once&quot; </li></ul></ul><ul><ul><li>End Sub </li></ul></ul>
  27. 27. Adding Command Button Controls to a Form <ul><li>Run the dialog box to see the results. </li></ul><ul><li>Hit Run then click on Run Sub/Userform </li></ul><ul><li>The CmdSendOrder_Click event procedure will run every time this command button is clicked in run mode. Because you haven't written code for the other controls yet, they don't respond to your mouse actions. Click the Close button on the title bar to return to design mode. </li></ul>
  28. 28. Adding Command Button Controls to a Form <ul><li>Let’s go to the next Command button </li></ul><ul><li>Name it Finish </li></ul><ul><li>To see all the events that command buttons recognize, click the down arrow next to the Procedure box in the Code window. Events that already have procedures written for them appear bold. Click an event name in the list to display its associated procedure. </li></ul>
  29. 29. Adding Command Button Controls to a Form <ul><li>To see the events for a different control on the same UserForm or for the UserForm itself, click the object name in the Object box in the Code window, and then click the arrow next to the Procedure box. </li></ul>
  30. 30. Adding Command Button Controls to a Form <ul><li>We are going to select Click </li></ul><ul><li>And type in </li></ul><ul><ul><li>DoCmd.CloseForm </li></ul></ul><ul><ul><li>Before End Sub </li></ul></ul><ul><li>Run the form and click on Finish </li></ul>
  31. 31. Entering the Create Presentation Procedure
  32. 32. PowerPoint Project 5 Complete

×