shell - getting a file to print to a specific printer using notepad and command line in visual basic -


i have been trying file print specific printer using notepad. have managed work when set printer in question default printer.

this code used achieve this:

shell("notepad /p c:\temp\test.txt") 

the issue i've got need send file printer when not default printer.

some applications (including notepad) support printto command. notepad's /pt printername. you'll have experiment printer name right - believe it's name of printer seen in control panel, may name of device or driver itself. (a few quick tests should figure out applies.)

shell("notepad /pt mylaserjet c:\temp\test.txt") 

of course, proper solution problem change application doesn't use shell("notepad",...) printing, sends text printer itself. can have user set printer once, save configuration, , automatically send text proper printer every time. using external application work app should workaround, not solution. :-) can't suggest how that, because you've provided no information application. there lots of questions here related printing every language , platform, though - can find 1 started little searching.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -