hi, i am a newbie...

would anybody please to tell me,
how is the codes, to directly changing windows default printer,
from within visualbasic code,
without poping: windows select printer dialog box

best regards
ndutz

Recommended Answers

All 7 Replies

Do you wish to change default printer or just use another ? How will program know which printer to pick if you don't put dialog box up ?

If your application changes users default printer without them knowing they could be very annoyed.

Denis

Look, "Epson Ex-1000" is the default printer for windows in all versions. It is the printer which anybody can use even if they don't physically have any printer installed to see the print preview. Now if you wish to change this printer setting to something else you've to first tell windows to what printer you want to switch on. You can write code to extract all printer names which are currently installed in a combo box. After that you select a printer and change to it. In this case you don't need to display the printer dialog box.

All your PRinters are listed in the printers collection.

The VB6.0 code would be

Sub Select_A_PRinter()

Set Printer = Printers("Your Printer Name")

End Sub

Look, "Epson Ex-1000" is the default printer for windows in all versions. .

Which country are you referring to ? We don't get this as default in any version of windows, except maybe Windows 3.0

Please fill me in.

Denis

thank you...
i try and i get:
runtime error 13
type mismatch

Set Printer = Printers("Your Printer Name")

thank you...
i try and i get:
runtime error 13
type mismatch

Which country are you referring to ? We don't get this as default in any version of windows, except maybe Windows 3.0

Please fill me in.

Denis

Belonging to some other country than you are won't change windows default printer from "Epson Ex-1000" to something else. It is the universal settings from Microosft which a few people know. You can only use this printer setting to make the print preview option functional while working in some text editors,word processors like notepad,wordpad,Ms-Word,etc. but cannot print anything. Windows doesnot automatically detect and install this printer. To install this printer setting you have to install all associated files from the installation disk of the version of windows which you've installed. To install this printer you can follow these steps :-

Insert the windows installation disk->goto control panel->printer->add new printer->select appropriate port->then from the printer selection screen click Epson from manufactures list and then select Epson Ex-1000 from printers list. After this clicking OK will install all necessary files for this printer onto your computer. Now if you goto print preview option of any text editor such as notepad you can see that option is working. I assume that you should know without installing a printer you cannot use the print preview option within any text editors. This printer setting is recommended for users who donot physically have any printer installed with their machine.

Hope this will clear your idea.

Regards
Shouvik

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.