Cleaning Up

The well-behaved macro cleans up after itself. In the course of carrying out its various tasks, a macro may open and close documents, change the settings of various options, and make other modifications before it is finished. Some of these changes may not be desirable to the user after the macro is done. For example, a macro designed to work on selected text may create a bookmark to mark an area of the document. The macro needs this bookmark, but the user doesn't; the macro should remove the bookmark when it's no longer needed.

Here's a checklist of possible cleanup tasks for your macro: