Solved

Printing Using the Common Dialog

Posted on 2002-04-23
11
195 Views
Last Modified: 2010-05-02
I want an example on how to use the Prining feature of the "Microsoft Common Dialog".
To be more specific, I want to get the value of the "selected printer" witch is returned by the "CommonDialog1.Hwd" property.
I want to use the "selected printer" in order to print a document in the "Acrobat Reader Control".
My Question is: How do I make the connection between the "Microsoft Common Dialog" and the "Acrobat Reader Control".
0
Comment
Question by:avissar
[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
11 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 6962210
You could skip the common dialog and use the ADOBE activex Control's printWithDialog method directly:

    Pdf1.SRC = "c:\ardent\uvodbc\uvodbc.pdf"
    Pdf1.printWithDialog

For example.
0
 
LVL 12

Expert Comment

by:roverm
ID: 6990011
You can get the default printer by reading the registry.
For W2K Pro it's this key:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows

String: Device

This will give you all printers available:

Sub Test()
Dim prt As Printer

    For Each prt In Printers
        List1.AddItem prt.DeviceName
    Next prt

End Sub

D'Mzzl!
RoverM
0
 

Author Comment

by:avissar
ID: 6990261
This doesn't answer my question, because in my application the user needs to choose a printer at start, and then the application prints the document automaticly.
Registry is not an option, because I open the common Dialog from the web.
0
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!

 
LVL 12

Expert Comment

by:roverm
ID: 6991886
Is your application in VB or ASP/HTML ?
0
 

Author Comment

by:avissar
ID: 6993233
Its an ASP/HTML application
0
 
LVL 12

Expert Comment

by:roverm
ID: 7004738
Then this can be very difficult...
Can you run any ActiveX components on the clients machines ?
0
 

Author Comment

by:avissar
ID: 7005410
Yes I can!
The problem I have exist also in VB.
After the user chooses a printer using the CommonDialog, I need to "tell" the Acrobat Reader to print with the selected printer.
0
 
LVL 12

Expert Comment

by:roverm
ID: 7005510
If you can run an ActiveX control you CAN change the registry and set the default printer temporary to the selected printer.
Is this still no option then ?
0
 

Author Comment

by:avissar
ID: 7006158
But I stil dont know what printer did the user choose.
How can I get that information from the CommonDialog control?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7660699
Hi avissar,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

avissar, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7755378
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

724 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