Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2006, 06:21 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default Default printer

  Hi guy's

     iam having an database contains three report in that i want to set two report in Laser printer & one in Dot matrix printer .what should i do for setting the printer as default printer (i.e.) when i given the print out it should automatically take the default printer

 Thanks in advance ..

 Bye,
 pap raguv:D
 
Old March 13th, 2006, 10:01 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

To set the default printer, for a network printer do this:

WshNetwork.SetDefaultPrinter(printername) 'UNC name

For a local printer:

Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.SetDefaultPrinter("\\ServerName\Printer Name")

Then print the job. This should work.

HTH

mmcdonal
 
Old March 21st, 2006, 06:19 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

Hi ,

 I can't understand your concpet pls give me an detail explanation

bye,
pap raguv
 
Old March 21st, 2006, 08:10 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

If you are automating the print job with a button click, then in the button's On Click event:

1. Check for the default printer and store its name.
2. Change the default printer to the printer required for the job.
3. Print the document.
4. Change the default printer back to the original default.

This code does item 2. I am surprised no one else posted.

HTH


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to retrive paper sizes of default printer gaurikhot .NET Framework 2.0 0 December 6th, 2008 06:23 AM
Function for Finding Default Printer smartgir Classic ASP Basics 0 February 7th, 2005 04:02 PM
Determining what default printer is in VBS/WSH dddane VBScript 1 April 30th, 2004 02:08 PM
How to change the default printer donrafeal Pro VB 6 4 April 27th, 2004 11:28 AM
Printing with default printer lletnek Beginning VB 6 1 March 4th, 2004 06:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.