Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 13th, 2006, 06:21 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
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
Reply With Quote
  #2 (permalink)  
Old March 13th, 2006, 10:01 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old March 21st, 2006, 06:19 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
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
Reply With Quote
  #4 (permalink)  
Old March 21st, 2006, 08:10 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.