Solved

Common dialog problem

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

726 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