Changing default printer using VBA

I want to put a statement in my code that changes the default printer to 
what I need it to be.  Please, what is that statement?

Richard Mogy 

9/19/2007 4:55:36 PM
access 16762 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 32

In Access 2002 or later, this is trivially easy.

Just set the Printer object, e.g.:
    Set Printer = Printers(0)
    Set Printer = Printers("Microsoft XPS Document Writer")

To reset to the default Windows printer:
    Set Printer = Nothing

For earlier versions it is more involved. See:
for Access 2000 or 97 respectively.

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -
Reply to group, rather than allenbrowne at mvps dot org.

"Rich Mogy" <> wrote in message
>I want to put a statement in my code that changes the default printer to 
> what I need it to be.  Please, what is that statement?
> Richard Mogy
9/19/2007 5:10:24 PM

Similar Artilces:

changing a line to a bar in "line-bar graph"
I have 4 qtrs of data and a benchmark set up in a line-bar graph. when the graph comes up, 3 of the quarters are reflected as bars; the 4th qtr appears as a line, along with the benchmark. I want to be able to change the 4th qtr to a bar. I need this for a board report - ASAP please Laurie - Right click on the series, choose Chart Type from the pop up menu, and select the chart type you want for that series. - Jon ------- Jon Peltier, Microsoft Excel MVP _______ Laurie M wrote: > I have 4 qtrs of data and a benchmark set up in a...

Account Format change
I need to add a new segment to my account framework and also increase a segment length for my existing accounts. For example: from 10-999, I need my account to read as 30-10-00999 where the first segment is the new segment and the last segment of 999 becomes 00999. Will Reformatter or the product from Microsoft do both of these things? Anyone has experience with this. I believe you need Reformatter from CRG. -- Charles Allen, MVP "Scott" wrote: > I need to add a new segment to my account framework and also increase a > segment length for my existing accounts. > ...

Outlook using MSN 6.0 and slows down system
Evener since I have installed MSN 6.0 outlook pauses several seconds everytime I click on a new mail in outlook. I noticed during this time that there was network activity whenever I clicked on a different mail in outlook. Using my firewall SW, I determined that MSN was being run(I had exited MSN) and was accessing the network everytime I clicked on a different mail. So the question is, How do I stop Outlook from calling MSN everytime I click on a new mail???? Ken What version of Outlook? Check Tools | Options | Other and disable IM integration. -- PATRICK REED [Outlook - MVP]~~~~~~ ...

"Today's Total Change" doesn't calculate in Portfolio Manager
I've had a problem with Money 2005 and 2006 Deluxe where the Portfolio Manager does not show "Today's Total Change" for stocks & mutual funds. It shows it for some, but not others...this is not only an annoyance, but prevents me from seeing how my investments are doing on a daily basis. What's interesting is that it shows today's change in the price of the stock or the NAV of the mutual fund, but Money seems to have issues with multiplying that by my number of shares to get "today's total change". I saw a patch for this in Money 2001, but it w...

version changes
i created a business card on Publisher (xp) but when i try to load it onto a computer w/ a color printer that has publisher ('97) it says i can't load stuff from another version. is there any way i can "downgrade" the project to make it compatible with the older version? didn't mean to post that twice. see above. ^^^ No there isn't. Copy the file to a disk and hie thee to a print shop. -- JoAnn Paules MVP Microsoft [Publisher] "Pringles." <> wrote in message news:285A2C89-D032-4123-87C0-0ABFF5B652A5@mic...

Possible bug in CRM-router when using it as a pop3
I have mentioned this before in my previous post. but I am now sure this is 100% bug. I have comfired it through 4 diffrent CRM setups. Issue. When an email address has aliases and and email is sent to the mail box to be picked up into the queue. the Queue breaks.. because CRM-router knows nothing about that alias email. example. mail account. aliases;;; an email is sent to the message hits the router and returns The e-mail message with ...

Referencing .NET 2.0 but end result uses .NET 3.5
I'm using DevStudio 2005 and I have a project that references System.dll ver 2.0.50727 and I accidentally compiled code that used an overload that only exists in version 3.5 because my intellisense showed it. I tried to compile it on another machine that never had the .NET 3.5 install and it wouldn't compile and the intellisense had that version of the overload yet both references looked identical; looking at ver 2.0 of System.dll The method in question was WaitHandle.WaitOne. ..NET 2.0 WaitOne() WaitOne(Int32, Boolean) WaitOne(TimeSpan, Boolean) ..NET 3.5 WaitOne...

Use Internet mail when offline
Hi All, I am using Outlook 2000 Sr1 with Exchange server 2000 When away with my laptop I am working offline, I dial to the Internet using a modem but when sending an e-mail it trys to connect to the Exchange server remotely to send it ... and stays in outbox folder. Is any way to get use only internet mail to delivery e-mails even when working online? Is any way to send e-mails using internet e-mail on dialup connection when I am away ? Regards, Ad Garett It sounds like you have your Exchange mail and Internet Mail in the same profile. Try separating them into 2 separate profiles, wit...

change cell change picture
Hi I'm using cell to display picture, for that, i saw a topic here with this example: but the problem is that i'm not getting the pictures displayed, it appears like example only without picture. I'm making the connection between picture and cells with INSERT -> NAME -> DEFINE. someone can tell me how can i do to work it out? thanks ...

Prompt for user to change passowrd...
Is there anywhere in setup where we can prompt a user to change their password? ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane.

assign shortcut using ALT
Hi, I want to assign the following shortcut to my macro: CRTL-ALT-F9, but the dialog doesn't allow ALT nor function keys. Is there any other way to achieve this? On the other hand, in Word I can pick any key on the keyboard including CRTL-ALT-F9. I'm using Office 2002. You would think that the two flagship programs in the same family would have the same capability to assign shortcuts. Any ideas? John John, You can use Application.Onkey. For the Alt Y combination, run this code (put it in Workbook_Open, perhaps): Sub AltKeyInit() Application.OnKey "%y", "MyMacro...

Change insidewidth property
hi i need to change the insidewidth property in plot area what size i want. for ex. if i am giving chatarea.plotare.insidewidth = 200 then it shows error because insidewidth is read only double. so how to change that value Hi, You can not change the value directly because as the error says it is a Read-Only property. You would need to change the 2 things that effect the value, plotarea width and axis labels. But it would be a case of trial and error. Cheers Andy M Selvaraj wrote: > hi > i need to change the insidewidth property in plot area what size i want. for > ex. if i a...

changing page layout
I did a document in publisher in portrait layout, with a picture and would like to make it a side fold document/ Setup a new publication as a booklet, copy/paste your objects from the older publication. -- Mary Sauer MSFT MVP news:// "chinadoll" <> wrote in message >I did a document in publisher in portrait layout, with a picture and would > like to make it a side fold document/ ...

How to use Find (Ctrl-F) to find non-alpha
Is there some way to search a sheet for anything BUT a-z or A-Z? tx ;-) Finding numerals or a mixture of numbers and letters (and other characters) works ok for me. What are you having trouble with? On 10/22/2010 16:31, Heather Mills wrote: > Is there some way to search a sheet for anything BUT a-z or A-Z? > > tx ;-) -- Dave Peterson On Fri, 22 Oct 2010 17:54:28 -0500, Dave Peterson <> wrote: >Finding numerals or a mixture of numbers and letters (and other characters) >works ok for me. > >What are you having trouble with? > >...

how to change the icon text
To all, What event to I do to handle when my app get iconified? I Need to set the window text for my icon differently than my app title bar text. When I run my app, the window text for the app title bar is "foo", when the user iconifies the app, I want the icon text to be "bar". How do I do that? Thanks for the help, Reza Take a look at CWnd::OnSysCommand. SC_RESTORE and SC_MINIMIZE is what you want to look for in this method. -- Ajay Kalra [MVP - VC++] "reza razavipour" <> wrote in message news:uK18XkXH...

Server Log on changes
When I try to send outgoing email my login iformation changes and I get the following message: Your message did not reach some or all of the intended recipients. Subject: test Sent: 5/22/2006 11:52 PM The following recipient(s) could not be reached: on 5/22/2006 11:54 PM You do not have permission to send to this recipient. For assistance, contact your system administrator. <mycompany.domain.local #5.7.1 smtp;550 5.7.1 Authentication is required to send mail as <>> Any Ideas...

How to change Pivot when SQL data source fieled name changed
Q: How to change Pivot when SQL data source field name changed I have a Pivot table that accesses a SQL data source. When one of the Fields Names in SQL is changed there is an error when trying to refresh Pivot Table. I cant find a way to edit the Pivot Table MS Query for the new SQL Columns Name like I can when just using MS Query to import data into excel vs into Pivot. Is this possible? Resolution: Call up the "Pivot Table Wizard" and hit Back Button to retrace steps and change data source "Nodak" wrote: > Q: How to change Pivot when SQL data source field...

change chart title with auto filter
I would like the title of my chart to change automatically every time I use the autofilter function to make a new selection of data to be displayed in the chart. Can anyone inform me of how to make the chart title change automatically with each new selection? Thanks, aja Hi, See this 'link' ( HTH -- Krishnakumar ------------------------------------------------------------------------ Krishnakumar's Profile: View this thr...

change default layout view
How can I get my emails to open up with the Print Layout View as default. Every time I compose a new message or open one from my inbox, the format defaults to normal view. ...

Using wild characters for an array
I have the following array: {=MAX(IF($H$3:$H$271="Lookup",$C$3:$C$271))} where it returns the max value. Is there a way to use * to say if lookup is in the string then that is an item to test the max on also. I was trying {=MAX(IF($H$3:$H$271="*Lookup*",$C$3:$C$271))} but that does not work. Is there a solution? Thank you for your help. Steven One way (array-entered): =MAX(IF(ISNUMBER(SEARCH("Lookup",$H$3:$H$271)),$C$3:$C$271)) If you want the search to be case-sensitive, use FIND() instead of SEARCH(). In article <2B31B788-8E24-46A2-8C45-D...

Change location of PST with IMAP accounts
Hi, I am currently using Outlook 2007 and have a question about IMAP. When using regular POP accounts, you can change the location of the PST by moving it to another place in Windows Explorer and the next time you start Outlook it will say the PST is missing and will ask where it is. Now, when using IMAP accounts this approach doesn't work. When you delete/move the PST that is associated with an IMAP account, Outlook will just redownload the mailbox from the server and create a new PST in the same location (%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook). I didn't f...

MaintainScrollPositionOnPostback undo javascript changes
I have two grids, and the for one of the grid I have given expand-collapse functionality usign javascript. And I have used MaintainScrollPositionOnPostback to maintain the position of the page. All works well, except since when i used MaintainScrollPositionOnPostback the grid wont remain collapsed on postpback. It expands everytime the page does post back. This application is published on sharepoint site. Please suggest. ...

Problem using AfxOleRegisterTypeLib to self-register dll
The code below did not successfully register my type library: const GUID CDECL LIBID_QTMovieFile = { 0x313B5622, 0x0F63, 0x4067, { 0x88, 0x17, 0x60, 0x1f, 0x15, 0x39, 0x5E, 0x25 } }; STDAPI DllRegisterServer(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); COleObjectFactory::UpdateRegistryAll(); if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), LIBID_QTMovieFile, _T("CreateMOV.tlb"), NULL)) AfxMessageBox(_T("Error in registering"),MB_OK,NULL); return S_OK; } However, using the following instead of AfxOleRegisterTypeLib worked fine: ITypeLib *pTypeLi...

PO status change
Hello! When we attempt to change the status of a PO from new to released using the Edit PO status window, it doesn't stay as released. If we change the line items individually or print the PO, then the status stays as released. Any ideas how to fix this? Thanks! -- MP MP, I am not sure this is necessarily wrong. If you print the PO to screen it will be released. It seems to me that is just as easy as the edit PO function. Unless you are importing lots of PO's and trying to automate the release function. Barry Wilson "MP" wrote: > Hello! When we attempt t...

using a cell that contains a reference
For some reason I can't find my first posting? Anyway.... I am trying to use the address that is in P3 'Exited!'!$E$10. Indirect("P3") returns 'Exited!'!$E$10, but I need the value that is in 'Exited!'!$E$10. I am trying to evaluate the value from 'Exited!'!$E$10 against q3 to see if they are the same, but I have to use reference in p3. Any ideas. Thanks. Hi try Indirect(P3) and when you type 'Exited!'!$E$10 into P3 you have to type ''Exited!'!$E$10 ie an extra apostraphe at the start of the cell - a better solution would...