?
Solved

Changing the win95 default printer

Posted on 1997-12-28
9
Medium Priority
?
283 Views
Last Modified: 2011-09-20
I nead to change the default printer of win95 using access
basic. I am using Access02.
any Help?

Amitai Medan
0
Comment
Question by:mAmitai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 4

Expert Comment

by:ozphil
ID: 1963812
Such a question should be valued at 100 points.

i think you must have inadvertantly left off a zero amitai.



0
 
LVL 1

Author Comment

by:mAmitai
ID: 1963813
1. New member
2. Who sets the prices here?

0
 
LVL 4

Expert Comment

by:ozphil
ID: 1963814
Could you try this please:

To change the Microsoft Windows default printer using Visual Basic code (or Access Basic code in version 2.0 or earlier), use WriteProfileString to change the Device= entry of the Microsoft Windows section of the Win.ini file.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 1

Author Comment

by:mAmitai
ID: 1963815
I tryed this with some win3.11 program and it seams to be working. But when I tryed it with Word 7.0 it did not.

as far as i anderstand the win95 stors this information
in two places:

1. win.ini file.
2. some other place, perhaps the registry.

When you update the win95 system it updates the win.ini as well
but if you update the win.ini file it does not updates the win95 system.

What i realy nead is some API function.

0
 
LVL 1

Expert Comment

by:ngpudding
ID: 1963816
I wonder if you could use the PrtDevNames property coz' I'm currently running Access95. Go to their Help to specify the above property as the search string.

But I do have a list of Printer APIs, unfortunately I forgot how to use them. But what you could do is get hold of a Win32 API book from any library of yours or any available sources on the Net, perhaps the MS newsgroup at microsoft.public.vb.api or at microsoft.public.access

I think you can not only find an answer and ask an answer but more than what you can think of. Good luck !!!

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Declare Function PrintDlg Lib "comdlg32.dll" Alias "PrintDlgA" (pPrintdlg As PRINTDLG) As Long

Declare Function PrinterMessageBox Lib "winspool.drv" Alias "PrinterMessageBoxA" (ByVal hPrinter As Long, ByVal error As Long, ByVal hwnd As Long, ByVal pText As String, ByVal pCaption As String, ByVal dwType As Long) As Long

Declare Function PrinterProperties Lib "winspool.drv" Alias "PrinterProperties" (ByVal hwnd As Long, ByVal hPrinter As Long) As Long

Declare Function ResetPrinter Lib "winspool.drv" Alias "ResetPrinterA" (ByVal hPrinter As Long, pDefault As PRINTER_DEFAULTS) As Long

Declare Function SetPrinter Lib "winspool" Alias "SetPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, pPrinter As Byte, ByVal Command As Long) As Boolean

Declare Function SetPrinterData Lib "winspool.drv" Alias "SetPrinterDataA" (ByVal hPrinter As Long, ByVal pValueName As String, ByVal dwType As Long, pData As Byte, ByVal cbData As Long) As Long
0
 
LVL 1

Author Comment

by:mAmitai
ID: 1963817
I prefer the answer of ozphil
how do I give him the points and grade him?
the answer of ngpudding was unusful.
0
 
LVL 12

Expert Comment

by:Trygve
ID: 1963818
mAmitai: Ozphil should repost his suggestion, and then you can grade him so that he receives the points. If he still have the email notification box checked out he will be notified by this comment and hopefully read it. If he does not respond you could insert a new question with 0 points attached to it telling him to go and get it. This question will get on top of the list and he will most surtainly read it.

Ozphil: claim your points.
0
 
LVL 4

Accepted Solution

by:
ozphil earned 150 total points
ID: 1963819
Thanks Guys. Now mAmitai just click the 'A' radio button. :-)

To change the Microsoft Windows default printer using Visual Basic code (or Access Basic code in version 2.0 or earlier), use WriteProfileString to change the Device= entry of the Microsoft Windows section of the Win.ini file.
0
 
LVL 1

Author Comment

by:mAmitai
ID: 1963820
Thanks a lot...
Case closed
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

801 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