Solved

Printing Using the Common Dialog

Posted on 2002-04-23
11
192 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
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

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

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…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 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