BUG: Compile Error on Print Statement in a With..End Block (182069)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q182069 SYMPTOMS
You invoke the Print method from within a With..End block, as follows:
With Form1
.Print "Generates Error"
End With
When 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.
RESOLUTION
Explicitly 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."
STATUS
Microsoft 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.
Modification Type: | Major | Last Reviewed: | 5/13/2003 |
---|
Keywords: | kbbug kbpending KB182069 |
---|
|