Solved

Common dialog problem

Posted on 2000-03-01
2
160 Views
Last Modified: 2010-05-02
Hi i am using the commondialog control to do a simple print of a form. I am using vb6 service pack 3

now when i display the print dialog box with, if i press cancel, it still sends the job to the printer, how can i stop it from going to the print que and get the cancel to work properly

thanx in advance

:)

CRaig
0
Comment
Question by:CraigLazar
[X]
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
2 Comments
 
LVL 2

Accepted Solution

by:
p_biggelaar earned 30 total points
ID: 2573154
Make sure you set CancelError to true

Either use On error resume next or On error goto to trap errornumber 32755 (Cancel selected)

Example:

CommonDialog1.CancelError = True
On Error Resume Next

CommonDialog1.ShowPrinter
If Err = 32755 Then 'Cancel pressed
  'Do what you want, but don't print
Elseif Err=0 then
  'Print
Else
  'There was another error
End If

I admit the example is not the recommended way to program, but it is meant to give you an idea of how to determine that Cancel was pressed.
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 2594788
Thanx
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

688 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