tailieunhanh - Using the Visual Basic Editor

Using the Visual Basic Editor Before you can write VBA macros, you need an editor. Outlook, like the other Office applications, includes the Visual Basic Editor. | Team LiB Using the Visual Basic Editor Before you can write VBA macros you need an editor. Outlook like the other Office applications includes the Visual Basic Editor. Open the editor interface by choosing Tools Macro Visual Basic Editor or by pressing Alt F11 on your keyboard. The Visual Basic Editor should be installed by default with a typical or complete installation. If it s not available you ll have to use the Add Remove Programs applet in Windows Control Panel and change your installed features. The Visual Basic Editor has all the tools you ll need. Use the Project Explorer to see all the modules you ve associated with Outlook and the Properties window to add or change properties including the project name and other properties. Type your code in the large window. Selecting Application in the Object drop-down list shown as General in Figure lists the available procedures in the right field and automatically enters the selection in the code window. Figure . Use the Visual Basic Editor to develop your macros. The Visual Basic Editor interface includes the Project and Properties browsers the main code window and the Standard toolbar. Right-click on the toolbars and show the Edit and Debug toolbars. Figures through detail the buttons found on these toolbars. Figure . The Standard toolbar has the standard Windows commands along with commands you can use to switch back to Outlook select a module form or class run your code and show the object browser and control toolbox. Figure . The Debug toolbar is used for your debugging code. Use Run Break and Reset to start and stop the macro and use Step In Out and Over to run the code line by line or skip lines. Use the windows and watches and see the results your code returns. Figure . Use the Edit toolbar to provide information about properties and methods in your code toggle breakpoints change indentation comment code blocks and use bookmarks while writing and debugging your code. One of .