View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
pt_lily pt_lily is offline
external usenet poster
 
Posts: 17
Default Select Printer Based on Criterea

Yes, they are all using the same string.

"Dave Peterson" wrote:

Does everyone connect to the printer using the same string?

Sometimes, people can connect using different strings:
\\someserver\someprintername on NE01:
or
\\someserver\someprintername on NE02:
or....

If different names can be used, then this won't work--but there may be
work-arounds.

Option Explicit
Sub testme()

Dim Resp as long
dim CurPtr as string
dim OtherPtr as string

curptr = application.activeprinter

resp = msgbox(Prompt:="Attachments?", buttons:=vbyesno)

if resp = vbyes then
application.activeprinter = "\\yourstringforthatprinterhere"
else
'do nothing or change to a different printer???
application.activeprinter = "\\adifferenterprinterhere???"
end if

'do the printing
worksheets("sheet99999").printout

'change the printer back to the user's choice
application.activeprinter = curptr

End sub

Uncompiled and untested. Watch for typos.


pt_lily wrote:

We currently have an excel order form that we are using and there are two
different printers that it can be printed to. Here is what I would like to
do:
I would like a macro that would bring up a message box stating "Do you have
anything to attach to this order?" and then the options of "Yes" and "No".
The option that they select would determine what printer their form would
print on. Is this possible?

Thanks!


--

Dave Peterson