Set Printer Defaults - Really important

Posted on 2006-05-31
Last Modified: 2012-05-05
Can I use a VBS / WSH script to set a default printer AND what the default orientation and paper size should be ?


\\server\printer1      landscape       A4.

etc ?
Question by:MarionTaylor
    LVL 6

    Expert Comment

    Yes, you can use wsh to set a default printer:

        Dim oWsh As Object
        Set oWsh = CreateObject("Wscript.Network")
        Call oWsh.SetDefaultPrinter("Printer A")

    But I don't think you can use it to set default orientation and paper size of the printer. To achieve that goal, you need to use a set of Printer Control APIs.
    LVL 15

    Accepted Solution

    HOWTO: Open the Printer Properties Dialog;en-us;q198860

    HOWTO: Set Which Printer Is the System Default Printer;en-us;q266767

    HOWTO: Use GetDeviceCaps to Determine Margins on a Page;en-us;q193943

    HOWTO: Connect to a Network Printer with the Win32 API;en-us;q154007

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    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 ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    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…
    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…

    761 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

    14 Experts available now in Live!

    Get 1:1 Help Now