Solved

Populate a combo box with installed printers

Posted on 2009-07-09
2
283 Views
Last Modified: 2012-05-07
I have had a look around for this and although it does seem possible i cant seem to find it. I am using VB2005.net and i want to populate a combobox with a list of installed printers. How can i do it.
Most things i have read say start with DIM DEV as PRINTER but printer is not avaliable as an option

Any ideas as this is urgent
0
Comment
Question by:bostonste
2 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 24813815
Loop through the PrinterSettings.InstalledPrinters collection adding the printers to a ComboBox
http://www.vb-helper.com/howto_net_list_printers.html
Imports System.Drawing.Printing
 

Private Sub Form1_Load(ByVal sender As Object, ByVal e As _

    System.EventArgs) Handles MyBase.Load

    Dim pkInstalledPrinters As String
 

    ' Find all printers installed

    For Each pkInstalledPrinters In _

        PrinterSettings.InstalledPrinters

        cboInstalledPrinters.Items.Add(pkInstalledPrinters)

    Next pkInstalledPrinters
 

    ' Set the combo to the first printer in the list

    cboInstalledPrinters.SelectedIndex = 0

End Sub

Open in new window

0
 

Author Closing Comment

by:bostonste
ID: 31601600
Thank you that was perfect
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now