R
Ryan Taylor
Hello,
We have a Word add-in developed in C# and are having an issue with how Word
changes its last selected printer. We would like to be able to print behind
the scenes using the Word COM object, and NOT change the last used printer in
Word.
Background info on our add-in:
When the user clicks our custom button, a print job is performed in the
background to one of the printers (it is always the same printer).
Also, in our code we account for the ActivePrinter issue, so that the
default printer on the system level is unchanged.
Example:
Customer has 3 printers: printerSystemDefault, printerUserChanged, and
printerOurCustom.
When the user first opens Word and selects print, Word will select the
printerSystemDefault printer by default. Close the print window.
Now, use our add-in by clicking the button. A print job is done behind the
scenes to the printerOurCustom printer. If the user now tries to do a
regular Word print (Ctrl P, etc) Word defaults to our custom printer,
presumably because it was the last printer used from within Word.
How can this be avoided? I tried storing the current ActivePrinter before
doing the behind the scenes, add-in print job, then setting the ActivePrinter
back, however that doesn't seem like the appropriate way to handle this and
it doesn't seem to work correctly. (it doesnt work correctly if the user
changes their printer to printerUserChanged. If they perform a print job to
printerUserChanged, then word will default to that printer. If I, in the
add-in code, store the ActivePrinter, it will in fact store this last
selected printer. When I set ActivePrinter back, however, it changes the
System Default Printer!)
Any help that you guys can provide would be greatly appreciated!
Thanks,
Ryan
We have a Word add-in developed in C# and are having an issue with how Word
changes its last selected printer. We would like to be able to print behind
the scenes using the Word COM object, and NOT change the last used printer in
Word.
Background info on our add-in:
When the user clicks our custom button, a print job is performed in the
background to one of the printers (it is always the same printer).
Also, in our code we account for the ActivePrinter issue, so that the
default printer on the system level is unchanged.
Example:
Customer has 3 printers: printerSystemDefault, printerUserChanged, and
printerOurCustom.
When the user first opens Word and selects print, Word will select the
printerSystemDefault printer by default. Close the print window.
Now, use our add-in by clicking the button. A print job is done behind the
scenes to the printerOurCustom printer. If the user now tries to do a
regular Word print (Ctrl P, etc) Word defaults to our custom printer,
presumably because it was the last printer used from within Word.
How can this be avoided? I tried storing the current ActivePrinter before
doing the behind the scenes, add-in print job, then setting the ActivePrinter
back, however that doesn't seem like the appropriate way to handle this and
it doesn't seem to work correctly. (it doesnt work correctly if the user
changes their printer to printerUserChanged. If they perform a print job to
printerUserChanged, then word will default to that printer. If I, in the
add-in code, store the ActivePrinter, it will in fact store this last
selected printer. When I set ActivePrinter back, however, it changes the
System Default Printer!)
Any help that you guys can provide would be greatly appreciated!
Thanks,
Ryan