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 


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

1 Replies
1898 Views

Similar Articles

[PageSpeed] 8

In Access 2002 or later, this is trivially easy.

Just set the Printer object, e.g.:
    Set Printer = Printers(0)
or
    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:
    http://www.members.shaw.ca/AlbertKallal/msaccess/printch2k.zip
or:
    http://www.members.shaw.ca/AlbertKallal/msaccess/printch97.zip
for Access 2000 or 97 respectively.

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

"Rich Mogy" <rmogy@sbcglobal.net> wrote in message
news:cwcIi.27877$eY.682@newssvr13.news.prodigy.net...
>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
-1
Allen
9/19/2007 5:10:24 PM
Reply:

Similar Artilces:

how to use excel to creat an oncall schedule
i wantb to creat oncall schedule for doctors in a hospital. each 2 doctors would be on call for 12 hours a day. it can look like calendar and it should calculae how many days each one was oncall up to date. ...

External data link change
Hi, I've a sheet linked to an external data on the net, and I would like that a cell in this sheet to indicate the last date and time it was updated, the simplest way the better but I can do some programming too. Thanks for your attention, -- Domingos Junqueira No need of help any more, I solved the question. Thanks again ...

Using HTML content as a Signature on Outlook 2000
Hi All, Have a HTML file that I need to setup as my signature in Outlook. I have been able to copy the Source, but the Preview Pane, and also the New Email window lists the Source and not the Resultant output. Have tried the above setting using the Message Format as HTML. Would appreciate assistance on the same. Warm Regards, Amar ...

Default Company at Login
What determines the default company that is displayed to the user at login? Is it simply alphabetical or is there somewhere to set as the default? i.e if we have 3 companies ABC-Company, 123_Company and All Other Company, Inc., can All Other Company, Inc. be forced as the default presented to the user? Thanks ------=_NextPart_0001_70567BB1 Content-Type: text/plain Content-Transfer-Encoding: 7bit If there is only 1 company in the list, the list will default to that company. If there is more than 1 company, nothing will default. You could do this trivially with Dexterity if you are o...

Why does the change change to a number?
Hi all, I've noticed something wierd and always wondered WHY it happens. When you type a date into a cell, and then change the Formatting of it to a 'general' cell, it turns into a number. How does it come up with that number? What is the significance? i.e. type today's date of "12/7/2007" - change it to a 'General' format, and it then says "39423". I'm a trainer of Excel and this question always comes up. I'm curious myself too. Thanks! Joe It's the number of days since January zero 1900 using Excel default for windows (M...

VBA Help Files #2
Kabel and Dibben - VBA Help files not on my installation CD any further clues as to where I can go on MSFT sites to find and download these files? Will start searching now yet could not find yesterday! TX JHAM Has been a long time since I installed Excel 97 and do not have the CD available. I think I remember that when originally installing the same thing happened to me when I chose the basic install......No VBA help files. Next time around I chose "Custom Install" and the VBA Help files were automatically downloaded and installed from the 'net. If you have the CD try the ...

changing the way Excel displays selected cells
Is there a way to change the way Excel displays selected cells? I'm interested in viewing all the selected cells highlighted (with light blue for instance), but by default excel highlights all the cells but not the first one the same occurs when you define a range with no adyacents cells Your definition of the display is not quite correct. Excel highlights the current cell, Excel also highlights a selecte range. The currently selected cell is generally the first of a range, bu press enter and the current cell changes and becomes the second, the third etc in the range. You cannot...

memory dump by using ctrl+scrlk+scrlk
To troubleshoot a server (w2k8, sp2) I have set up to do memory dump using ctrl+scrlk+scrlk and dedicated dump file. I tested it and it triggered the dump. But I expected the server to reboot itself at the end but it didn't. It showed 100% complete and stayed at the blue screen. I had to manaully power it down/on. Is it supposed to like this? After reboot a new memory.dmp was created. I guess it is working but just curious if it should reboot itself once done. Any idea? Thanks. Chris;1259949 Wrote: > To troubleshoot a server (w2k8, sp2) I have set up to do...

Track Changes
How do i remove the track changes in outlook? When i press "Enter", a symbol that represents "Enter" will appears. Same for space etc. ...

DST changes for Exchange 5.5
I noticed the 2007 DST Calendar Update "Exchange tool" is available now: http://support.microsoft.com/kb/930879 This will seemingly take care of calendars for mailboxes still on Exchange 5.5 servers, as Exchange 5.5 is listed as "compatible" . However would this address the CDO issues such as BlackBerry users and OWA users still on Exchange 5.5 ? Thanks in advance, Itrcb4 On Mon, 12 Feb 2007 14:31:00 -0800, itrcb4 <itrcb4@discussions.microsoft.com> wrote: >I noticed the 2007 DST Calendar Update "Exchange tool" is available now: > >http://su...

Stop sheet showing when Using Datapig's Force Users to enable macr
Hi, I think this is probably not do-able I'm using Datapig Technologies example to force users to enable macros When the workbook is closed all sheets other than a warning sheet are very hidden so that if the workbook is opened with macros disabled then the user can only see a warning sheet saying to close and open with macros enabled. Then on opening with macros enabled the waring sheet is very hidden and the other sheets can be seen. Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.ScreenUpdating = False Sheets("Warning").Visible = True Sh...

more on VBA function name change
I thought I'd start a new thread since I haven't received any replies to my first one... To recap: I've declared a function in a module using mixed case: Function TMDE_Category (FormName As Form) I noticed recently that it appeared in the module as Function tmde_category(FormName As Form) I changed it back to the mixed case declaration, saved the module, exited the app, reopened it and looked. The function had changed back to the all lowercase declaration. Things I've tried since the original post: Using the databse documenter, I selected all ob...

Can't Publish changes with Deploy Manager
After a migration process, I can't publish the changes made on CRM. When I try do this in Deploy Manager I get the follow error: ---------------------------------------------------------------------------- ----- Publish done with errors. See the event log to get deitails NETRA-INOVACAO: ***Error*** Failed to download XSL template files from Web Server ---------------------------------------------------------------------------- ----- Can somebody help me? I don't know if the migration process have any relationship with the error. Thank you for pay attention. []'s Vin´┐Żcius Pitta...

How to change icon for my application
Hi, I am currently developing an application on visual studio 6.0, and i wish to change the MFC icon on my application header. Anyone can help? Thank you. Raed Sawalha wrote: > Hi, I am currently developing an application on visual studio 6.0, and i > wish to change the MFC icon on my application header. Anyone can help? Thank > you. > > Open the icon resource for editing by double clicking. Then notice the control just above the editing grid that lets you switch between editing the large icon and editing the small one. -- Scott McPhillips [VC++ MVP] thanx that work...

OWA as default web page
I have a front end server I'm using for OWA. I would like to configure IIS to default to the login prompt when the user hits the web server, without having to type "/exchange". For example: https://webserver.domain instead of https://webserver.domain/exchange Is there a way to configure this? Thanks The article below describes how to redirect the Default Web page to point to the Exchange virtual directory. 319878 XWEB: How to Make Outlook Web Access the Default Web Site http://support.microsoft.com/?id=319878 >-----Original Message----- >I have a front end server...

epson printer
im having trouble with my printer can anyone help me. the problem is it is giving error after every print or doesnt finish the print and just stops and says unsuccessful. i turn off then on and it does same thing. what can i do besides buy a new one.can anyone help. i have tried everything buy not working and i cant leave off because then my draw doesnt open. What kind of printer is it? What are you trying to print? What kind of interface (serial, usb)? What drivers are you using (Opos or windows)? Post this information and someone will probably be able to help you. Kinnard L. Koh...

Send.Item message when using mapi emailing
Hi, When using the MAPI profile to send mails via Send.Item Outlook stops and shows the Yes, No message for permission to send. I have checked all IE settings and Outlook but cant turn this off? I know its there somewhere, any help locating and turning off this setting would be fantastic! Kind Regards James See http://www.outlookcode.com/d/sec.htm for your options with regard to the "object model guard" security in Outlook 2000 SP2 and later versions. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, an...

Excel Pivot Items Using C#
I am working on a C# add-in that modifies pivot tables. I have done this work in VBA, and the object model seems straightforward, e.g., PivotTable-PivotFields-PivotItems, but I can not get the object for PivotItems, or iterate through the items. Do I need something other than PivotItems? Code for PivotFields, that works: IExcel.PivotFields pvtfs = (IExcel.PivotFields) pvtTable.get_PageFields(Missing.Value); foreach (IExcel.PivotField pvtf in pvtfs) { Code for the does nto work, and PivotItems shows no va...

using IMAP and Outlook to share folders on 5.5 SP4?
I've got a client with 5.5 SP4 who wants to be able to drag an email from his inbox to a shared folder that his assistant can access. The server is outside their network, so can only use IMAP or POP3 I tried opening up port 143 for IMAP and created a new public folder using Outlook. I can see this new folder using Exchange Administrator app. When I drag an email from the Outlook inbox into the new public folder, I get a msg of: Can't move the items. The server responded: REFERRAL imap://userName:AUTH="@server.com/Public/%20Folders/Test] there is no replica for that mailbox o...

How to change newsgroup message font
Like many other ribbon based programs I sometimes struggle to find how to make a change. This time its how to change the font just for newsgroup messages? regards "nobody" wrote in message news:EWTao.39493$GF5.7129@hurricane... > Like many other ribbon based programs I sometimes struggle to find how to make a change. This time its how to change the font just for newsgroup messages? Newsgroup messages are usually plain text. The font used is that selected at [no name tab] > Options > Mail > Read > Fonts for the encoding specified for the messag...

Notify change of email address when changing ISP
How do I notify my entire address book of an email address when I change ISP's? Thanks By sending a mail to everyone ? If you do so, please use BCC for the adresses, this way you won't spread everybody's e-mail adres to everybody. Niels Bob Baker wrote: > How do I notify my entire address book of an email address when I change ISP's? > Thanks ...

Change a formula to an acual number
I want to change the formula I have created to the number it has created Example: Cell A1 is the number 1. Cell A2 is the formula =a1+1 creatin the number 2. I want this to be a two not a formula. Any ideas? Laura, copy, then paste special, valves -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 97 ** remove news from my email address to reply by email ** "Laura" <anonymous@discussions.microsoft.com> wrote in message news...

Transferring data IN VBA between workbooks
I need to transfer a range of cells for every row one by one from one file File1.xls to a second file File2.xls from within a VBA program. I had it running where it coded a cut and paste but the program runs for 3 hours and If I tried to do anything else where I cut and paste I would get data from my running program when I tried to paste. Is there any way I can do this other than cut and paste ? Dennis I foud out what I was doing wrong I had this Range("A1") = Range("A1:P1") which will work in a single workbook but to a separate workbook you have to put Range("...

Problem Changing an Investment Name
I am trying to change an investment name and Money 2006 tells me "The name or symbol 'TRP Spectrum Income' has already been used for a deleted investment. Please enter a different name." When I go to delete investments the name does not appear! Any ideas on how I get Money to accept the name change? This is the first time I have run into this situation and I have made numerous name changes in Money over the years. In microsoft.public.money, Ken wrote: >I am trying to change an investment name and Money 2006 tells me "The name >or symbol 'TRP Spec...

Should I change this code?
Should I change 556 to 560???..............Thanks for your help..........Bob Private Sub Command560_Click() On Error GoTo Err_Command556_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmClientInfomation" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command556_Click: Exit Sub Err_Command556_Click: MsgBox Err.Description Resume Exit_Command556_Click End Sub On Sun, 15 Jul 2007 16:37:26 +1200, "Bob V" <rjvance@ihug.co.nz> wrote: > >Should I change 556 to 560???..............Thanks for your help.....