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 with a message


Hello

I have a form that inputs data into a sheet then you click a button to
print 2 copies (one on a green sheet and one on a white sheet)

BUT Is it poss before printing a message box to appear and ask the user
to insert the "white copy" then after printing a second message box to
appear asking the user to insert "Green copy"

Is it also poss for a macro to control a printer and make it form feed
the sheets the reason is when printing the white and green copy you
have to form feed them and when you print from any other program or a
different excel sheet it prints from the paper tray. I know that this
is a long shot!!!!

Thanks


--
Rmagic
------------------------------------------------------------------------
Rmagic's Profile: http://www.excelforum.com/member.php...o&userid=28595
View this thread: http://www.excelforum.com/showthread...hreadid=486655

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Printing with a message

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 can 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 the 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


Worked for me.

---------------

--
Regards,
Tom Ogilvy



"Rmagic" wrote in
message ...

Hello

I have a form that inputs data into a sheet then you click a button to
print 2 copies (one on a green sheet and one on a white sheet)

BUT Is it poss before printing a message box to appear and ask the user
to insert the "white copy" then after printing a second message box to
appear asking the user to insert "Green copy"

Is it also poss for a macro to control a printer and make it form feed
the sheets the reason is when printing the white and green copy you
have to form feed them and when you print from any other program or a
different excel sheet it prints from the paper tray. I know that this
is a long shot!!!!

Thanks


--
Rmagic
------------------------------------------------------------------------
Rmagic's Profile:

http://www.excelforum.com/member.php...o&userid=28595
View this thread: http://www.excelforum.com/showthread...hreadid=486655



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing with a message


hi
Thanks for code

I have tried but get a "Run time error 52"

The code

Sub Macro5()
Dim ctrl As Long
Dim tmpstr As String
Open "EPSON Stylus CX3200 on Ne00:" 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


Thanks for the help


--
Rmagic
------------------------------------------------------------------------
Rmagic's Profile: http://www.excelforum.com/member.php...o&userid=28595
View this thread: http://www.excelforum.com/showthread...hreadid=486655

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Printing with a message

Notice the sample code did not have the "On Ne00"

--
Regards,
Tom Ogilvy


"Rmagic" wrote in
message ...

hi
Thanks for code

I have tried but get a "Run time error 52"

The code

Sub Macro5()
Dim ctrl As Long
Dim tmpstr As String
Open "EPSON Stylus CX3200 on Ne00:" 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


Thanks for the help


--
Rmagic
------------------------------------------------------------------------
Rmagic's Profile:

http://www.excelforum.com/member.php...o&userid=28595
View this thread: http://www.excelforum.com/showthread...hreadid=486655



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
Reminder message before printing Jim G Excel Discussion (Misc queries) 7 April 26th 07 02:52 AM
error message during printing Urgent ! Excel Discussion (Misc queries) 1 February 1st 06 05:03 PM
error message during printing Urgent ! Excel Discussion (Misc queries) 0 February 1st 06 04:17 PM
Printing on message box condition? Simon Lloyd[_659_] Excel Programming 1 October 24th 05 12:48 PM
Deactivating Printing Message TONYC[_10_] Excel Programming 7 August 14th 04 12:54 AM


All times are GMT +1. The time now is 11:16 PM.

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

About Us

"It's about Microsoft Excel"