
Tips.Net > WordTips Home > Macros > Creating Macros > Debugging a WordBasic Macro
Summary: How to get the bugs out of your macro. (This tip works with Microsoft Word 6, and Word 95.)
When you write a macro, you need to test it and correct any errors in the macro. This process is called debugging. The process of debugging a macro in WordBasic is the same as debugging in any other programming language. All you need to do is step through the macro, one command at a time, and make sure it works as you think it should. You do this by viewing both the windows for your macro and a test document. As you step through the macro (using the controls in the WordBasic toolbar), you can correct any errors you locate.
As you are debugging macros, you need to make sure you think through every possible way the macro could be used and all the possible conditions that could exist at the time the macro is invoked. Try the macro out in all these ways and under all these conditions. In this way, you will make your macro much more useful.
Tip #750 applies to Microsoft Word versions: 6 95
Step Up and Take Control! Subscribers to WordTips know just how valuable a resource it is. WordTips Premium provides twice the number of exceptional, easy-to-understand tips every week in an ad-free newsletter, as well as substantial discounts on WordTips archives and e-books.
Check out WordTips Premium today!
Learn to search for and replace text, formatting, graphics, and special characters the easy way with WordTips: Find and Replace. (more information...)
Ask a Word Question
Make a Comment
Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips