Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Default Printer

Posted on 2004-04-23
4
Medium Priority
?
273 Views
Last Modified: 2010-05-02
Hello,
  Can someone help me, I am trying to get the name of the current default printer, I am using VBA (Microsoft Access 2000).

I want to be able to display the current name of the default printer.  

Cheers everyone.

0
Comment
Question by:PhillipBarber
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
aelatik earned 500 total points
ID: 10899747
Wmi call would do it...

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Printer", , 48)
For Each objItem In colItems
    If objItem.Attributes And 4 Then ' attr nr. 4 represents default printer
       MsgBox objItem.Name
    End If
Next
0
 
LVL 14

Expert Comment

by:aelatik
ID: 10899852
in VBA this also result the default printer...

MsgBox Application.ActivePrinter
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 10900497
msgbox printer.DeviceName
0

Featured Post

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.

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…
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 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…
Suggested Courses

916 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