BUG: Compile Error on Print Statement in a With..End BlockLast reviewed: March 5, 1998Article ID: Q182069 |
The information in this article applies to:
SYMPTOMSYou invoke the Print method from within a With..End block, as follows:
With Form1 .Print "Generates Error" End WithWhen you run the project, the following error message is displayed:
Compile Error Method or Data not found. CAUSE"Print" is a reserved word. If Print is used within a With statement, Visual Basic incorrectly parses the word.
RESOLUTIONExplicitly reference the object when invoking the Print method. For example, use the following code sample to eliminate this behavior:
Form1.Print "Printed on the Form." STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
Keywords : vb5all VBKBEnv VBKBVB vbwin kberrmsg Version : WINDOWS:5.0 Platform : WINDOWS Issue type : kbbug Solution Type : kbpending |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |