I'd like to prompt the user for an Address ID number (easy enough) then call some SQL code (also easy to do) show the address to the user (probably in an MDL) then (here's the part I am not sure how to do in MacroSched) Let the user choose a printer and send the formatted output to that printer.
Do I use VBScript for the printing portion of this?
SkunkWorks
Print a label?
Moderators: JRL, Dorian (MJT support)
Easiest way is to use WriteLn to write the text to a .txt file and use Notepad:
Let>RP_WAIT=1
Run>Notepad /p %filename%
That will print to the default printer. You can show a list of printers and set/change the default with VBscript. There's an example here:
http://www.mjtnet.com/forum/viewtopic.php?t=1465
Or how about just open the file in Notepad, send keystrokes to invoke the print dialog and leave it to the user to select a printer and hit ok. Wait for the print window to close and then close Notepad and continue with the script?
There are probably other ways to do it in VBScript using the FileSystem object. You could also maybe use the DOS PRINT command or just COPY the file to the printer device. But why bother with all that when the above works fine and is nice and easy?
Let>RP_WAIT=1
Run>Notepad /p %filename%
That will print to the default printer. You can show a list of printers and set/change the default with VBscript. There's an example here:
http://www.mjtnet.com/forum/viewtopic.php?t=1465
Or how about just open the file in Notepad, send keystrokes to invoke the print dialog and leave it to the user to select a printer and hit ok. Wait for the print window to close and then close Notepad and continue with the script?
There are probably other ways to do it in VBScript using the FileSystem object. You could also maybe use the DOS PRINT command or just COPY the file to the printer device. But why bother with all that when the above works fine and is nice and easy?
MJT Net Support
[email protected]
[email protected]