The UndoRecord is not necessary for your macro but it is handy if there is a chance you want to UNDO all the steps of the macro with a single keystroke.
Word's undo command steps backwards through the most recent document changes. When a macro performs a lot of changes to a document it takes a lot of consecutive undo commands to reverse out all the changes made by that macro. Those lines in Brian's code groups all of those single steps into a single undo command.
So if you don't expect to undo the macro's changes then it will make no difference to the code if you include or don't include those lines.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|