Solved

Printing Using the Common Dialog

Posted on 2002-04-23
11
190 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
11 Comments
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 12

Expert Comment

by:roverm
Comment Utility
Is your application in VB or ASP/HTML ?
0
 

Author Comment

by:avissar
Comment Utility
Its an ASP/HTML application
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Expert Comment

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

Author Comment

by:avissar
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now