If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
Outlook macro help please
"Victor Delta" wrote in message
... "Victor Delta" wrote in message ... "PaulD" nospam wrote in message ... 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 |
#22
|
|||
|
|||
Outlook macro help please
Im running Windows XP with Outlook 2003. My print dialog only shows the
active printer in a pull down list that is disabled so the printer can't be changed. I do not see my others printers in the dialog or any black tick marks. As Ken stated earlier, since Outlook doesn't offer any control over printing, I doubt it would have a refresh option available but I'll see if I can find anything. Paul D Paul D "Victor Delta" wrote in message ... : "Victor Delta" wrote in message : ... : "PaulD" nospam wrote in message : ... : 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 : |
#23
|
|||
|
|||
Outlook macro help please
"PaulD" nospam wrote in message
... Im running Windows XP with Outlook 2003. My print dialog only shows the active printer in a pull down list that is disabled so the printer can't be changed. I do not see my others printers in the dialog or any black tick marks. As Ken stated earlier, since Outlook doesn't offer any control over printing, I doubt it would have a refresh option available but I'll see if I can find anything. Paul D Try opening an HTML email and then pressing Ctrl + P - then you'll see the print dialogue box I'm talking about (Outlook has different ones for plain text and HTML emails). When I click Ctrl + P with the same email selected but closed instead of open, I get the same dialogue box that you are talking about and curiously this seems to have the effect of refreshing the printer as if I then open the email and press Ctrl + P, the new default printer is selected... I wonder if this gives us a way to solve the refresh problem i.e. close the email, open print dialogue, cancel, open email, and then print...!? I don't know if this is possible? We're so very close to a solution... Regards, V |
#24
|
|||
|
|||
Outlook macro help please
For the record I never print emails while they are open... for that matter I
never open them since I keep a preview window open below, so when I select an email, I can see it in the preview. All of the test printing I did using the macro was from selected email in the main window, not open emails. Paul D "Victor Delta" wrote in message ... : "PaulD" nospam wrote in message : ... : Im running Windows XP with Outlook 2003. My print dialog only shows the : active printer in a pull down list that is disabled so the printer can't : be : changed. I do not see my others printers in the dialog or any black tick : marks. As Ken stated earlier, since Outlook doesn't offer any control : over : printing, I doubt it would have a refresh option available but I'll see if : I : can find anything. : Paul D : : Try opening an HTML email and then pressing Ctrl + P - then you'll see the : print dialogue box I'm talking about (Outlook has different ones for plain : text and HTML emails). : : When I click Ctrl + P with the same email selected but closed instead of : open, I get the same dialogue box that you are talking about and curiously : this seems to have the effect of refreshing the printer as if I then open : the email and press Ctrl + P, the new default printer is selected... : : I wonder if this gives us a way to solve the refresh problem i.e. close the : email, open print dialogue, cancel, open email, and then print...!? I don't : know if this is possible? : : We're so very close to a solution... : : Regards, : : V : |
Thread Tools | |
Display Modes | |
|
|