P
Peter Woods
Hi all,
I'm developing a (managed) COM add-in for Outlook. I'd like it to be able to
intercept a user viewing or saving an attachment to a mail, and potentially
modify the attachment content so that it appears to be different.
So I've been looking at the attachment events. I can see there's quite
a range of them, but they don't give the add-in the full picture
of what's happening.
For instance, if I right-click an attachment and 'save as' then I get this
event:
ItemEvents_10_BeforeAttachmentWriteToTempFileEventHandler
But looking at the caracteristics of the arguments, I can't tell where
the user has requested the attachment to go or where the temp file is,
and many of the attachment properties are read-only.
It seems I can't modify the attachment content (there's no access
to change it from the attachment object) and can't write different
data to the temp location where it's trying to write it to, because
it doesn't tell me where that is.
Is it possible to modify an attachment at the time when it's being
referenced? Could I do it using a property accessor for the
PR_ATTACH_DATA_BIN property? Or by using the MAPIOBJECT property
and dropping into MAPI code to do the modification? Or is it deliberately
not possible?
I could potentially implement my requirement by modfiying
the attachments when I get an OnNewInspector (or inspector Activate)
in anticipation that the user might view or save them,
but that's quite an overhead.
I know this sort of thing can be done using the Exchange Client Extension
interface, but I'd prefer to develop against the COM Add-in interface
if at all possible.
Any suggestions
Peter
I'm developing a (managed) COM add-in for Outlook. I'd like it to be able to
intercept a user viewing or saving an attachment to a mail, and potentially
modify the attachment content so that it appears to be different.
So I've been looking at the attachment events. I can see there's quite
a range of them, but they don't give the add-in the full picture
of what's happening.
For instance, if I right-click an attachment and 'save as' then I get this
event:
ItemEvents_10_BeforeAttachmentWriteToTempFileEventHandler
But looking at the caracteristics of the arguments, I can't tell where
the user has requested the attachment to go or where the temp file is,
and many of the attachment properties are read-only.
It seems I can't modify the attachment content (there's no access
to change it from the attachment object) and can't write different
data to the temp location where it's trying to write it to, because
it doesn't tell me where that is.
Is it possible to modify an attachment at the time when it's being
referenced? Could I do it using a property accessor for the
PR_ATTACH_DATA_BIN property? Or by using the MAPIOBJECT property
and dropping into MAPI code to do the modification? Or is it deliberately
not possible?
I could potentially implement my requirement by modfiying
the attachments when I get an OnNewInspector (or inspector Activate)
in anticipation that the user might view or save them,
but that's quite an overhead.
I know this sort of thing can be done using the Exchange Client Extension
interface, but I'd prefer to develop against the COM Add-in interface
if at all possible.
Any suggestions
Peter