Solved

how to give the NumberOfCopies to the WinSpool function StartPagePrint function

Posted on 2008-10-23
2
270 Views
Last Modified: 2008-10-28
Question:
I use the class RawPrinterHelper from microsoft support(see http://support.microsoft.com/kb/322091). I added one more parameter "Copies" to function:
Public Shared Function SendFileToPrinter(ByVal szPrinterName As String, ByVal szFileName As String, ByVal Copies As Integer) As Boolean, changed:bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, fs.Length) to :
Dim i As Integer
For i = 1 To Copies
    bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, fs.Length)
Next

But if the copies is big number(999), print spool service gets errors. I know it is not a good way to tell the printer how many copies to print by sending multiple times for the same data. I wonder if we can set the copies in StartPagePrint or what is the best to tell the functions the number of copies.
0
Comment
Question by:smurri
2 Comments
 
LVL 13

Expert Comment

by:SameerJagdale
ID: 22785876
0
 

Accepted Solution

by:
smurri earned 0 total points
ID: 22786174
The proposed way does not work for us.

We will use the printer commands for the printer and connect directly.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question