Step-By-Step Example
1. On a Microsoft NT 4.0 system, add a printer with a name that contains a space. 2. Create a text file in the C:\ folder, for example, test.txt. 3. Start a new Standard EXE project in Visual Basic. Form1 is created by default. 4. From the Project menu, select References, check Microsoft Scripting Runtime, and click OK. 5. Add a CommandButton to the form. 6. Paste the following code in the code window of Form1: |
7. Press the F5 key to run the project, and then click on the CommandButton. 8. The file test.txt is printed if the DeviceName is one word without spaces. 9. Alternatively, you can use APIs to bypass the printer driver and send data to the printer. This is documented in article Q154078 listed below in the "References" section. |
|