?
Solved

Printing Using the Common Dialog

Posted on 2002-04-23
11
Medium Priority
?
196 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

770 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