Does anyone know how to send a file directly to the printer, no matter what the file type is? I have a set of files currently that I double click on and they are sent directly to the printer. Or I am asked to define the file type. Can this be done in VB. Either printing direct to the printer, or performing a double click type scenario on the file through VB?
No, I didnt mean your code didn't work, I meant my revised code.
Basically I need to open files that do not have file associations. I need to do this through VB. What could you suggest? All the files need to opened through my xPrint application "C:\xPrint\vpxPrint.exe".
At the moment if i go to my file, right click and use the "Open With" option from windows, I browse to the vpxPrint.exe. Once I have selected this it opens perfectly. With your code I get the error;
"unknown input file C:\hello"
If this does not work is there anyway to save the current file name in a variable and then rename the file it so it includes the file extension. Once I have finished with the file rename it back to its orignal name?
andyb7901
ASKER
I have it working on the C: file now. However, when i do it on one of my real files it doesnt seem to like spaces. I have the following file to be read into the xPrint file;
have you tried:
MyProcess.StartInfo.Arguments = "c:\hello."
MyProcess.StartInfo.Arguments = "c:\hello"
andyb7901
ASKER
I now have it working using;
Dim MyProcess As New Process
MyProcess.StartInfo.FileName = "C:\xPrint\vpxPrint.exe"
MyProcess.StartInfo.Arguments = """c:\hello\SUPPLIER NOTIFICATION-3177-0504200747522"""
MyProcess.Start()
Thanks for all your great help!
Éric Moreau
for the space, surround your file name with double quotes: