4.6. The Bottom Line

Set up the Visual Basic Editor for creating procedures. How you arrange the various components of the Visual Basic Editor is your personal choice, but while using this book, it's easiest if you set up the editor to resemble the way it appears in the book's figures. Besides, this arrangement is quite close to the default layout, which has proven to be the most effective one for the majority of programmers (according to various focus groups and polls) for the 17 years that Visual Basic has employed an editor.

Master It Display, then hide, the Properties window.

Create a procedure for Word. Using the Help feature in any VBA-enabled application allows you to find code examples that you can copy and paste into your own code.

Master It Open the Code window and use Help to find a code example.

Create a procedure for Excel. Certain procedure names are special. In the previous exercise, you added line numbering and gave that procedure a name of your own choice. But some procedure names have a special meaning — they represent an event. They will execute automatically when that event takes place (you don't have to run events by choosing Run from the Macro dialog box, or by assigning the macro to a keyboard shortcut or Quick Access Toolbar button). One such event is Excel's Workbook_Open procedure.

Master It Display a message to the user when a workbook is opened in Excel.

Create a procedure for PowerPoint. As you type a procedure, the Visual Basic Editor provides you with lists of objects' members (the Auto List Members feature) and with syntax examples, including both required and optional arguments (the Auto Quick Info feature). These tools can be invaluable in guiding you quickly to the correct object and syntax for a given command.

Master It Use the Auto List Members and Auto Quick Info features to write a macro that saves a backup copy of the currently active presentation.

Create a procedure for Access. Although Access includes a variety of features that are unique, its Visual Basic Editor is quite similar to the Visual Basic Editors in the other Office 2007 applications.

Master It Open the Visual Basic Editor in Access and write a macro that displays today's date using the Date function rather than the Now function. Use the Access Visual Basic Editor Help system to understand the difference between these two functions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.240.58