Microsoft KB Archive/298135

= PRB: Print Method Does Not Appear in the Object Browser Window or Auto List Members Feature =

Article ID: 298135

Article Last Modified on 6/25/2004

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Enterprise Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 4.0 Standard Edition

-



This article was previously published under Q298135



SYMPTOMS
The Print method of the Printer, Form, or UserControl object does not appear in the Object Browser window or in the Auto List Members (ALM) feature.



CAUSE
The Object Browser window only displays objects and their associated methods. Methods such as Print are not associated with Printer, Form, or UserControl objects. Instead, they are general methods that Visual Basic attaches to these objects. Because they are not intrinsic methods, they are not displayed in the browser or by IntelliSense.



MORE INFORMATION
To verify this, check the Visual Basic object library with the OLE Viewer that ships with Microsoft Visual Studio as follows:

Steps to Use the OLE Viewer

 * 1) From the Windows Start menu, point to Programs, point to Microsoft Visual Studio 6.0, point to Microsoft Visual Studio 6.0 Tools, and then click OLE View.
 * 2) In the OLE Viewer, click the TypeLib Viewer button that has three red triangles on it, or click View TypeLib on the File menu. An Open dialog box appears.
 * 3) Browse to the VB6.olb file, and then click Open. (The default path for VB6.olb is C:\Program Files\Microsoft Visual Studio\VB98\Vb6.olb.)
 * 4) From the View menu, ensure that the Group by type kind check box is selected. A list of folders appears in the left pane.
 * 5) Click to expand the CoClasses, coclass Printer, _Printer, and Methods folders. Notice that the Print method does not appear in this list.
 * 6) Repeat the previous step for the coclass Form and coclass UserControl folders.

NOTE: The ALM feature was included in Visual Basic 5.0 and is not available in earlier versions.

Steps to Reproduce Behavior
NOTE The following steps are specific to Visual Basic 6.0 and differ slightly in earlier versions, especially Visual Basic 4.0.  Create a new Standard EXE project in Visual Basic 6.0. Form1 is created by default. From the Tools menu, click Options. On the Editor tab, make sure that the Auto List Members check box is selected, and then click OK. Double click on the form to go into the Form_Load event in the code window. Type the following line exactly (including the PERIOD):

Printer.

When you type the period, the ALM feature displays the available properties and methods alphabetically. Note that the Print method is not listed. If you finish typing the line as Printer.Print and press the ENTER key, Print turns blue (by default) to indicate that the method is known. From the View menu, click Object Browser, or press the F2 key. In the Object Browser window, the combo box in the upper left should default to <All Libraries>. You can leave this or select VB.</li> Scroll down the left pane, and then click Printer. Scroll the list of members in the right pane. Notice that Print is not listed.</li></ol>

Keywords: kbprint kbide kbprb kbideproject KB298135

-

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

© Microsoft Corporation. All rights reserved.