Making an available printer Active

  • Thread starter David Macdonald
  • Start date
D

David Macdonald

Hello all, I'm not quite a novice but...
I've seen the article on word.mvps.org about getting a list of all the
available printers and can get it into a ListBox without any problem.
But how do I get one of the printers from the list to be the ActivePrinter ?
I want a basic form without offering any chance to change print parameters -
just the a.m. ListBox and a button that says "Print" and will hide the form
when finished.
 
D

Doug Robbins

See the other article on selecting a printer without changing the default.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

David Macdonald

Thanks, Doug
mvps.org seems to be down at the moment but I've seen that article in the
past. What I can't figure out is how to connect the two routines.
How do I get the printer I highlight in the ListBox to be the one that is
used?
 
D

David Macdonald

Hello Graham,
I see the site's working again - I was trying at 9 o'clock from Italy and
couldn't connect...
I prefer your MyPrint solution to the one proposed on the Word MVPS site for
my "Print" button. But my problem is getting the name of a printer into where
you write "Put the name of the required printer here" from a ListBox on the
same form.
I should explain more - the form will be popping up from a shared template
on the company net and everyone has different combinations of local and
networked printers. So it's not a question of manually writing the printer
name.
As I said, I've got as far as sucking out a list of available printers and
checking that it works from other PCs on the LAN, but I'm a Quality System
chap not a real programmer. It'll be something to do with arrays, Dim and
strings but in what order and combination has me totally stumped. I would be
very grateful for any help.
Desperate Dave
 
D

David Macdonald

It took me a couple of days trawling the net and the VBA help files and of
course the solution was easy.
"ActivePrinter = ListBox1.Value" in Graham's code!
It may not seem much to the more experienced coders but I'm very proud of
myself.
;-)
And in the long run I probably learned a little more by trial and error,
tweaking the work of the masters than if someone had just handed me the
answer on a plate.
Long live the mvps.org site and all its contributors!!
 
G

Graham Mayor

I'm sorry I didn't get back to you earlier - but there's nothing like
finding out the hard way ;)
Actually this ability to select from available printers may be a useful
adjunct to the original macro. I guess I might have to go away and modify it
:(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top