Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Setting printer copies

Posted on 2002-04-10
4
212 Views
Last Modified: 2010-05-02
I'm allowing the user access to the print common dialog using

dlbCommonDialog.ShowPrinter

After closing the dialog a variable is set to the number of copies selected with the .Copies property.

However, the number of copies selected doesn't clear when the application is closed, so the next time the user runs the app the number of copies is the same as was set in a previous session. In addition, some (not all) other applications, even COTS, pick up this print copy value. I've tried

dlgCommonDialog.Copies = 1

on program load and on program close, but it makes no difference. Even though the .Copies property shows 1 if I put in a break to check, the dialog will still show whatever the previously set number was. Do I need to make an external call to reset the .Copies value when the program closes? Or what?
0
Comment
Question by:rdolivaw
  • 3
4 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 50 total points
ID: 6932507
This is a known bug, check out this article on MSDN:
BUG: nCopies Does Not Initialize the Print Common Dialog Box (Q197393)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q197393

Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6932519
And here is another article that should help:

PRB: CommonDialog Changes System Wide Printer Properties (Q198712)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q198712

Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6932525
And finally, when you get a chance please maintain these open questions:

Main form not visible after splash form unloads Date: 10/16/2001 11:21AM PST  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20193933
FormFlow anyone? Date: 12/20/2001 09:00AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=prodappgen&qid=20247993

Anthony
0
 

Author Comment

by:rdolivaw
ID: 6936727
Thanks a lot, Anthony. Since I'm already testing for which OS is on the computer I've just disabled the menu choice for print setup on the W95 boxes on program load. Seems to work ok on the W2K boxes, so that's all right. I'm using Active Reports(tm) for the reporting function, and clicking the Print button on the display window automatically pops up the Print dialog -- this one doesn't have the bug mentioned above, so that's ok, too, and the user can select number of copies there.

Thanks again. I'll take care of the old queries -- EE has been a little recalcitrant of late.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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