Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing Sheets sorryipurchased Excel Discussion (Misc queries) 0 January 20th 10 06:31 PM
Printing XL Sheets name Muhammad Rizwan Khan - XL Sheets Name Excel Discussion (Misc queries) 1 February 19th 08 08:23 AM
PRINTING two sheets on ONE? Fecozisk Excel Discussion (Misc queries) 3 August 31st 06 04:49 AM
Printing sheets. Dabber Excel Worksheet Functions 2 June 5th 05 08:00 PM
Programme Printing of Several Sheets Rob Excel Programming 0 May 8th 05 11:45 AM


All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"