WD: Cannot Trap WordBasic Err=7, "Out of Memory"

Last reviewed: February 6, 1998
Article ID: Q85369
The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Word for the Macintosh, versions 6.0, 6.0.1, 6.0.1a

SYMPTOMS

In Microsoft Word, you cannot trap the following error message using the On Error macro command:

   WordBASIC Err=7
   Out of memory

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been corrected in Microsoft Word 97 for Windows.

MORE INFORMATION

Steps to Reproduce Problem

The following macro demonstrates this problem:

   Sub MAIN
   On Error Goto Bye
   Error 7       ' Generates the "Out of memory" error message
   Bye:
   MsgBox "Did we get this far?"
   End Sub

When you run this macro, the "Out of memory" error message will be displayed. When you choose the OK button in the error message dialog box, the macro will halt. The MsgBox command will not be executed.

All other WordBasic-generated error messages can be trapped using the On Error statement. For example, if you change the Error 7 statement in the above macro to Error 11 (that is, "Division by zero"), Word for Windows will jump correctly to the Bye: label and execute the MsgBox command. The Error 11 message box will not appear.

REFERENCES

"Using WordBasic," by WexTech Systems and Microsoft, page 341


Additional query words: word95 word97 8.0 8.0 winword winword2 2.0 2.0a
cannot errmsg err msg insufficient macword 6.0.1 word7 word6 winword
trapping
Keywords : kbmacro
Version : 1.x 2.x 6.0 6.0a 6.0c 7.0 7.
Platform : MACINTOSH WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 6, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.