double-click or save attachment

  • Thread starter Thread starter Steffen Heinzl
  • Start date Start date
S

Steffen Heinzl

Hi!

I would like to react to a user's saving an attachment.
Is there an event that I can use, such as clicking on save as or
double-clicking the attachment.

Thanks,
Steffen
 
According to the Object Browser (F2) you have BeforeAttachmentSave. Always
check in the Object Browser to see what events, methods and properties are
available for any object or collection.
 
Ken said:
According to the Object Browser (F2) you have BeforeAttachmentSave.
Always check in the Object Browser to see what events, methods and
properties are available for any object or collection.

Thanks. But the problem is that BeforeAttachmentSave is triggered, when
the mail arrives and not when the user tries to save the attachment.

Yours,
Steffen
 
Sorry, you're correct. It is not fired when an attachment is saved to the
file system. In that case, no, there's no event for that in the Outlook
object model.
 
Ken said:
Sorry, you're correct. It is not fired when an attachment is saved to
the file system. In that case, no, there's no event for that in the
Outlook object model.

Any idea how I can change an attachment, when a user tries to access it?
 
Hack the window!!!
For Outlook2003,the attachments list container is a rich editor ,it's
windows class name called "RichEdit20W";

For Outlook2000,the attachments list container is a list view window,it's
window class name is "SysListView32".
 
Steffen said:
Any idea how I can change an attachment, when a user tries to access it?

What is the actual problem you're trying to solve? Here are a couple
ideas that might help you to get around the current issues, but
knowing the real problem might help someone else to think of a better
approach to a real solution.

What about saving ALL attachments to the file system in
BeforeAttachmentSave or related event? Then you can control access to
who opens the files, and you can control what happens when they open
the file from triggers or application code outside of Outlook. You
may want to remove the attachments from Outlook after they've been
saved. I use a macro to remove attachments, put them into a specific
location based on sender and date, and then the body of the mail is
updated with the location of the related file(s).

Here's software for doing something similar:
<http://www.sperrysoftware.com/Outlook/Attachment-Save.asp?Source=RS>

Is there a way to stop users from doing a SaveAs in Outlook? If so,
then you can turn off the user ability to save attachments and give
them a custom routine of your own. For the above macro I click a
toolbar button - that's an event you can trap.

About changing an attachment, it depends what the attachment is. If
the user opens a Word document, you can use a Word macro or add-in to
see where the file is coming from, and to take some action. If the
path contains "Temporary Internet Files\OLK" then you know Outlook has
the file open.

You can also change that temp directory and then put a
FileSystemWatcher on it so that you can see what's getting dumped into
it and take action. See this KB article for info:
http://support.microsoft.com/kb/817878

HTH
 
Back
Top