Microsoft Office 2000 Developer |
It’s a good practice to add thorough comments to any code that you write. Although it may be perfectly clear to you how your code works, it may not be clear to someone else (or even to yourself) when that code needs to be modified a year from now. Clear comments can save you a lot of time and effort in the future.
The VBA Code Commenter add-in helps you to add consistent comments to your code, including author name, date and time of creation, and other pertinent information. It inserts a header template at the beginning of a procedure; you simply fill in the blanks. You can choose to add comments to a single procedure, to all of the procedures within a module, or to all procedures in your project at once.
To add comments to your code
Note The VBA Code Commenter menu item is only available when the VBA Code Commenter add-in is loaded. For more information about loading add-ins, see Accessing Office 2000 Developer Tools.
The VBA Code Commenter uses template files (.eht) to control the format of comments. You can edit the standard template (CodeCommenter.eht) or create your own templates using Notepad or another text editor.
For more information about the templates, see Code Commenter and Error Handler Template Formats and Chapter 11, "Add-ins, Templates, Wizards, and Libraries" in the Microsoft Office 2000/Visual Basic Programmer's Guide.