Solved

Common dialog problem

Posted on 2000-03-01
2
158 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
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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 …
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

777 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