Solved

Changing the win95 default printer

Posted on 1997-12-28
9
274 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
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 50 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

726 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