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
Solved

Changing the win95 default printer

Posted on 1997-12-28
9
269 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

829 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