MrProgrammer
Programmer
You know when you print a document, there is an option like "print to file". With this option, you can print a document into a .prn file, copy it into a floppy disk and carry it into other computers. Then in that computer's command prompt, you give a command like below,
c:\COPY /B ABC.PRN LPT1
so you print that .prn file in that computer.
I want to know whether there is a way of doing this with VBA code. I mean is there a way to use command prompt with VBA. I tried to use Sendkeys method after running command.com with Shell function and sent commands character by character but it didn't work. I got \ characters every time. I tried to use FileCopy method of File object but I don't know How I can represent the printer (LPT port) as destionation. Can you help me please?
c:\COPY /B ABC.PRN LPT1
so you print that .prn file in that computer.
I want to know whether there is a way of doing this with VBA code. I mean is there a way to use command prompt with VBA. I tried to use Sendkeys method after running command.com with Shell function and sent commands character by character but it didn't work. I got \ characters every time. I tried to use FileCopy method of File object but I don't know How I can represent the printer (LPT port) as destionation. Can you help me please?