Prevent adxWordEvents_DocumentBeforePrint on docs printed from Outlook

Add-in Express™ Support Service
That's what is more important than anything else

Prevent adxWordEvents_DocumentBeforePrint on docs printed from Outlook
 
Ole Andreas Ringdal


Guest


I have developed an Office 2007 Word-addin with an event that fires before documents are printed (adxWordEvents_DocumentBeforePrint). Sometimes, users need to print emails as well as all attachments contained in the email.

However, it is not desirable to have Word fire this adxWordEvents_DocumentBeforePrint event when printing emails with Word attachments. Is it possible to prevent this? Perhaps by somehow detecting when Word was started from Outlook?

If there is a solution to this, it needs to take into account that Word may already be started when emails are printed, since users typically have several documents open at a time.

I certainly hope someone can help me out on this one, since it's a big annoyance for the lawyers this solution is implemented for, who often print emails with dozens of Word attachments.

Add-in Express 2007 for .NET, Professional v3.4.1868, Office 2007 Enterprise.

Kind regards,
Ole Andreas Ringdal
Posted 15 Jun, 2007 08:06:13 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ole Andreas.

I will investigate this issue and let you know about results soon.


P.S. Note that we take up your forum requests in the order we receive them. Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 15 Jun, 2007 16:46:06 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ole Andreas

I am afraid I can't fully realize the fact of the matter. Please describe the issue in more details. Do you print emails directly from Outlook or just open all attachments in Word separately?
Posted 16 Jun, 2007 08:35:48 Top
Ole Andreas Ringdal


Guest


Hello, Sergey.

The users receive emails with several Word document attachments, and sometimes they need to print the email as well as all of its Word document attachments. This they do by opening the email, going to File | Print, and in the print dialog, checking "Print attached files. Attachments will print to the default printer only." In other words, they print everything from within Outlook. (Which then opens the Word attachments in Word, prints them, and closes Word.)

The user most likely already has Word open in the background, since the client is a law firm in which users mostly work with several Word documents at a time. Therefore I mentioned in my first post that any solution, if found, needs to take into account that Word already may be running when Outlook opens it to print attachments. And will of course need to still be running when Outlook has finished printing.

FYI, the add-in presents the user with a form where he has to select which header/footer combination he wants to apply to the document before saving or printing it. Headers/footers are set by this add-in, and document variables are used to store which header/footer combination is selected for the document so that the user is not presented with the form every time the document is saved or printed. When the user receives documents by email, they need to be printed unmodified, so it is not desirable to have the add-in present the user with the form when printing emails and attachments from within Outlook.

Best regards,
Ole Andreas Ringdal
Posted 16 Jun, 2007 15:10:50 Top
Ole Andreas Ringdal


Guest


Just in case I was a bit unclear to begin with: The event is meant to fire (and correctly does so) when regular Word documents are printed from within Word. The event is not meant to fire when Word documents are printed from Outlook when those documents are attachments to an email and the user selects to print the email as well all attachments.
Posted 18 Jun, 2007 17:53:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ole Andreas.

Thank you for the explanation.
Now I don't have any ideas on how you can detect that Word attachments are printed from Outlook. I will let you know if I find any solution.
Posted 19 Jun, 2007 08:30:45 Top
Ole Andreas Ringdal


Guest


Hello again, Sergey.

Just a question: Maybe I'm wrong, but isn't there for every application a property or variable that tells which other application or process that launched it?
Posted 19 Jun, 2007 16:39:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ole Andreas.

The point is that a COM add-in is an inproc server. Thus the application that loads the add-in is always Word.
Posted 20 Jun, 2007 08:21:31 Top