Microsoft KB Archive/236480

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

Article ID: 236480

Article Last Modified on 5/18/2000

-

APPLIES TO


 * Microsoft Office 2000 Developer Edition

-



This article was previously published under Q236480





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 that this is 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
 Open any Microsoft Office 2000 program. Press ALT+F11 to switch to the Visual Basic Editor. On the Insert menu, click Module.  Type the following code: Sub Test MsgBox "Testing" End Sub  Make sure the pointer is located inside the procedure that you created in step 4.</li> On the Add-Ins menu, click VBA Code Commenter. 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.

</li> Under Add Comments to, click Current Procedure, and then click OK.</li> On the Edit menu, click Undo Insert Text. Note that all the code between the lines "Sub Test" and "End Sub" is deleted.</li></ol>

Additional query words: pra

Keywords: kbbug kbpending KB236480

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.