V
Victor Delta
"Victor Delta" <none@nospam.com> wrote in message
news:%23TRmogYqJHA.200@TK2MSFTNGP05.phx.gbl...
> "Victor Delta" <none@nospam.com> wrote in message
> news:OKENscNqJHA.5832@TK2MSFTNGP06.phx.gbl...
> > "PaulD" <nospam> wrote in message
> > news:%23cCpZtJqJHA.1172@TK2MSFTNGP05.phx.gbl...
> >> Victor,
> >> You were correct to change 'Dim WshNetwork As Object', that should work.
> >> Since you could follow my directions before, I would recommened you try
> >> this: set a break point on the line
> >> For i = mySelection.Count To 1 Step -1
> >> in the PrintGreen sub and then run the code. You should be able to
> >> hover
> >> over the strDefault variable to see if it was set, then open your
> >> printers
> >> and faxes window and see if the default printer was switched. To make
> >> sure
> >> I have the same code as you I copied the code from your post below into
> >> a
> >> new module and ran it to make sure it worked. I got an error saying it
> >> couldn't find the printer "GREENPRINT" which is good since I don't have
> >> that
> >> printer. I changed it to a network printer I do have (CutePDF) and it
> >> worked. Investigae some more and post back with your results
> >> Paul D
>
>> Paul
>
>> Thanks. This is most odd. Followed your instructions and sure enough,
> > using
> > the break point, the default printer does change to Green Print and then
> > changes back. However, the print out still seems to go through to the
> > wrong
> > printer, although on a couple of occasions when using Step into (F8) I
> > got
> > it to go to Green Print. I've been trying again and for the last 10
> > minutes
> > it will only go to the wrong printer!
>
>> I'll do some more experimentation but not quite sure why it should be so
> > inconsistent! Any ideas? We're so nearly there...
> Have done some more experimentation and believe I have now found the
> problem - and it's very interesting.
> To aid clarity lets call the two printers Printer A (normal default) and
> Printer Green. Once Outlook is open, if you change the default printer
> (either manually or via your macro with the break point on the "For i =
> ..." line) if you hover over the Print button at the top of any email, you
> will see the name of the new printer (in my case Printer Green). This
> looks very promising...
> However, there's a big gotcha! If you now open the Outlook Print dialogue
> box (Ctrl +P), although you will see the little black tick against the
> name of the new default printer, the original printer (Printer A) is
> actually still selected (highlighted in blue). So if you now print, either
> by clicking the button or running the second part of your code, the email
> goes to the original printer. I guess this is what Ken was telling us all
> along!
> If only there were a way to 'refresh' the printer selection to the new
> default printer it would work but, so far, I haven't thought of one. Any
> ideas?
> The only surprise now is that you've managed to make it work at your end.
> I've been using Windows XP with Outlook XP/2002 and, on another machine,
> Outlook 2003. Same as you?
> V
Just another thought... If it's really not going to be possible to
automatically send emails to Printer Green, then a poor 'second best'
solution would be to only print the first page. From googling on this, I
gather there is no simple way to do this either, unless someone knows
differently...?
V
news:%23TRmogYqJHA.200@TK2MSFTNGP05.phx.gbl...
> "Victor Delta" <none@nospam.com> wrote in message
> news:OKENscNqJHA.5832@TK2MSFTNGP06.phx.gbl...
> > "PaulD" <nospam> wrote in message
> > news:%23cCpZtJqJHA.1172@TK2MSFTNGP05.phx.gbl...
> >> Victor,
> >> You were correct to change 'Dim WshNetwork As Object', that should work.
> >> Since you could follow my directions before, I would recommened you try
> >> this: set a break point on the line
> >> For i = mySelection.Count To 1 Step -1
> >> in the PrintGreen sub and then run the code. You should be able to
> >> hover
> >> over the strDefault variable to see if it was set, then open your
> >> printers
> >> and faxes window and see if the default printer was switched. To make
> >> sure
> >> I have the same code as you I copied the code from your post below into
> >> a
> >> new module and ran it to make sure it worked. I got an error saying it
> >> couldn't find the printer "GREENPRINT" which is good since I don't have
> >> that
> >> printer. I changed it to a network printer I do have (CutePDF) and it
> >> worked. Investigae some more and post back with your results
> >> Paul D
>
>> Paul
>
>> Thanks. This is most odd. Followed your instructions and sure enough,
> > using
> > the break point, the default printer does change to Green Print and then
> > changes back. However, the print out still seems to go through to the
> > wrong
> > printer, although on a couple of occasions when using Step into (F8) I
> > got
> > it to go to Green Print. I've been trying again and for the last 10
> > minutes
> > it will only go to the wrong printer!
>
>> I'll do some more experimentation but not quite sure why it should be so
> > inconsistent! Any ideas? We're so nearly there...
> Have done some more experimentation and believe I have now found the
> problem - and it's very interesting.
> To aid clarity lets call the two printers Printer A (normal default) and
> Printer Green. Once Outlook is open, if you change the default printer
> (either manually or via your macro with the break point on the "For i =
> ..." line) if you hover over the Print button at the top of any email, you
> will see the name of the new printer (in my case Printer Green). This
> looks very promising...
> However, there's a big gotcha! If you now open the Outlook Print dialogue
> box (Ctrl +P), although you will see the little black tick against the
> name of the new default printer, the original printer (Printer A) is
> actually still selected (highlighted in blue). So if you now print, either
> by clicking the button or running the second part of your code, the email
> goes to the original printer. I guess this is what Ken was telling us all
> along!
> If only there were a way to 'refresh' the printer selection to the new
> default printer it would work but, so far, I haven't thought of one. Any
> ideas?
> The only surprise now is that you've managed to make it work at your end.
> I've been using Windows XP with Outlook XP/2002 and, on another machine,
> Outlook 2003. Same as you?
> V
Just another thought... If it's really not going to be possible to
automatically send emails to Printer Green, then a poor 'second best'
solution would be to only print the first page. From googling on this, I
gather there is no simple way to do this either, unless someone knows
differently...?
V