Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing 3 sheets with VB and new to this
Hello i have created macro just for simple printing sheets but i cam across this code from a early thread and would like some help on it s i would be able to use it (how to do it basic) I want to be able to print 3 different sheets but but for a message t appear before each one asking you to insert (form feed ) the correc colour paper "Please insert White copy" and you press ok and print then green cop and then yellow. The bit am also after is getting the printer to for feed but if you use the printer any other time it just prints from th tray the Thread with the code seems to say this is poss http://www.excelforum.com/showthread.php?t=486655 Here is part of the thread You can try sending a form feed character to the printer (chr(12) as I recall) msgbox "White paper" ActiveSheet.Printout msgbox "Green paper" ActiveSheet.Printout Here is information from an old post on printing directly that you ca adapt to sending a form feed (it already includes a form feed in the demo). -------------------------- Actually you don't need to create a text file. You can write to the printer, same as writing to the file: the below prints several lines but you should be able to adapt it to your situation. Sub Macro5() Dim ctrl as Long Dim tmpstr as String Open "LPT1:" For Output As #1 Print #1, "[Start of Printing Test]" For ctrl = 1 To 10 tmpstr = "Printing:" + Str(ctrl) Print #1, tmpstr Next tmpstr = "[End of printing test]" + Chr(12) Print #1, tmpstr Close #1 End Sub To a Network printer First, I went to the immediate window in the VBE to query th activeprinter string ? activePrinter \\ARDAPS01\1D343E on Ne02: then I used the first part in the below code: Sub Macro5() Dim ctrl As Long Dim tmpstr As String Open "\\ARDAPS01\1D343E" For Output As #1 Print #1, "[Start of Printing Test]" For ctrl = 1 To 10 tmpstr = "Printing Line " + Str(ctrl) Print #1, tmpstr Next tmpstr = "[End of printing test]" + Chr(12) Print #1, tmpstr Close #1 End Sub Thanks for you hel -- runaway2 ----------------------------------------------------------------------- runaway21's Profile: http://www.excelforum.com/member.php...fo&userid=2904 View this thread: http://www.excelforum.com/showthread.php?threadid=48773 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Printing Sheets | Excel Discussion (Misc queries) | |||
Printing XL Sheets name | Excel Discussion (Misc queries) | |||
PRINTING two sheets on ONE? | Excel Discussion (Misc queries) | |||
Printing sheets. | Excel Worksheet Functions | |||
Programme Printing of Several Sheets | Excel Programming |