AllExperts > Visual Basic 
Search      
Visual Basic
Volunteer
Answers to thousands of questions
 Home · More Visual Basic Questions · Answer Library  · Encyclopedia ·
More Visual Basic Answers
Question Library

Ask a question about Visual Basic
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Amal Raj A
Expertise
Can answer basic VB questions those are related to commonly used controls, VB/Access related questions, basic Flexgrid solutions

Experience
I have working with VB-Oracle/Dbase/Access for the past 4 years.

Education/Credentials
Brainbench Certification in VB 6.0

 
   

You are here:  Experts > Computing/Technology > Basic > Visual Basic > Printing a file

Visual Basic - Printing a file


Expert: Amal Raj A - 11/3/2009

Question
I am using VB6 and am trying to print a file without ever opening it. This can be accomplished outside of VB by right-clicking the file and then clicking 'Print'.

However, I would like to print files using this manner without opening the file in my application OR using code to physically right-click the file.

To clarify, I am trying to print a file by simply knowing it's path & filename. Certainly there is a way to do this in VB6.

I appreciate your help in advance!

Answer
Hi Enoctis,

I cannot provide you the complete code for now. But I can offer some tips. You would need to use the shell command in conjunction with the DOS type command to print the file without opening it.

This is to just emulate the DOS command type filetoprint.txt > prn, where the command (directs) prints the file "filetoprint.txt" to the printer.

Hope this helps.

Regards,

Amal

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.