[Resolved] Printing: Set Document Name in Print Queue (thanks Merrion)
Question 1
When I print from VB6 the local print queue (spooler, print manager or whatever its called) shows document name as "Microsoft Visual Basic"
Is there a simple way of changing that to a more meaningful document name - such as the client's account number etc? (by 'simple' I mean without all that terrifying API stuff that gives me the willies - If API is the only way could somebody please give me some very straightforward code as I am very very newbie when it comes to API.)
Question 2
Is there a simple (see definition above) way of getting back from the printer a value to say it has satisfactorily completed a particular print job. My printer loves to crash in the middle of a stack of documents "Your job waiting to be printed was deleted" and I have no idea which one of them failed to print without manually going through the whole stack and trying to remember which ones I had just tried to print.
I have searched the knowledge base and previous posts and nothing yet meets my needs (or my definition of simple!)
Thanks in anticipation...
Changing Document Name in Print Spooler [RESOLVED]
Sir Merrion, I salute you. It works. Thankyou.:D
I made a slight modification to your suggested code. Rather than call a subroutine that renames every job in the list, I want each job to have a unique name. Therefore I have used the following code immediately after my Printer.EndDoc method - I am assuming that jobs are added to the end of the queue - so that the most recent (ie current) job should be vbPrinter.PrintJobs.Count
VB Code:
Printer.EndDoc
Set vbJob = vbPrinter.PrintJobs(vbPrinter.PrintJobs.Count)
vbJob.DocumentName = "Account no " & frmClient.accountID
Again, a thousand thanks. May your road always be smooth etc.:) :) :)