[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

How to get specific Printer name in Commondialog Name Box

When I launch:
commondialog1.showprinter
how do I get a specific printer name to appear in the
printer NAME box.
?
0
rbend
Asked:
rbend
  • 4
  • 2
1 Solution
 
rovermCommented:
Hi (again)!

I found a very good article about setting the default printer:

http://www.freevbcode.com/ShowCode.Asp?ID=641

This is also a good solution for your other question, I will post it there as well.

It uses the ini file to change the default printer and broadcasts the change to all applications.

D'Mzzl!
RoverM
0
 
rbendAuthor Commented:
roverm:
The code you sited does change the default printer. That's good. But it does not tell me what the original printer was. Therefore, I can't change it back.
0
 
rovermCommented:
Yep you can!
You can alter the class module to read the default printer first.
I will take a look also. "I'll be back..." ;-)

D'Mzzl!
RoverM
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
rovermCommented:
*lol*

Some easy code to read the current printer:

Public Function GetCurrentPrinter() As String
Dim curPrinter As Printer
   
    Set curPrinter = Printer
    Debug.Print curPrinter.DeviceName
    GetCurrentPrinter = curPrinter.DeviceName
   
    Set curPrinter = Nothing
End Function

D'Mzzl!
RoverM
0
 
Valliappan ANCommented:
Well, thats a good link, which hope, I have been using for some time, to change the default printer.

BTW, In case of Commondialog, you could have a look at this:
http://www.devx.com/premier/mgznarch/getstarted/1999/gs299/psgs299.pdf

It states, you set TrackDefault property to True, gets the defa. printer name to Common dialog. Setting it to false, gets the recently used printer. Also, PrinterDefault property set to True makes the selected printer to default printer, if I understood right.

Hope it helps,
Cheers.
0
 
rbendAuthor Commented:
you worked hard and covered my need.
Thanks
0
 
rovermCommented:
Thanks!

D'Mzzl!
RoverM
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now