MOD2000: Code in Procedure Is Deleted When You Click Undo Insert Text or Press CTRL+Z

ID: Q236480


The information in this article applies to:
  • Microsoft Office 2000 Developer

Moderate: Requires basic macro, coding, and interoperability skills.


SYMPTOMS

When you click Undo Insert Text or press CTRL+Z to remove comments added by the VBA Code Commenter add-in or to remove code added by the VBA Error Handler add-in, all of the code in your procedure or function is erased.


RESOLUTION

To recover the code, click Undo Delete on the Edit menu or press CTRL+Z. If the Undo Delete command is unavailable, you must retype the code or copy it from a backup version of the project.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft Office Developer Tools.


MORE INFORMATION

When you click Undo Insert Text or press CTRL+Z the first time, all the code is erased. When you click Undo Delete or press CTRL+Z the second time, the code is restored without the comments or the code that is inserted by the add-in.

Steps to Reproduce Behavior

  1. Open any Microsoft Office 2000 program.


  2. Press ALT+F11 to switch to the Visual Basic Editor.


  3. On the Insert menu, click Module.


  4. Type the following code:


  5. 
    Sub Test()
       MsgBox "Testing"
    End Sub 
  6. Make sure the pointer is located inside the procedure that you created in step 4.


  7. On the Add-Ins menu, click VBA Code Commenter.


  8. For more information about adding add-ins, click Microsoft Access Help on the Help menu, type add-ins manager in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.
  9. Under Add Comments to, click Current Procedure, and then click OK.


  10. On the Edit menu, click Undo Insert Text.


  11. Note that all the code between the lines "Sub Test" and "End Sub" is deleted.

Additional query words: pra

Keywords : kbdta AccCon
Version : :
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: August 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.