D
Darius
Hi,
I'have written a COM add-in for Outlook using VC++. This COM-Addin
should detect new send mails. After sending a mail (with several
attachments) I have to separate all attachements from mailItem, then
save each attachment as a single file, save mailitem without attachments
as msg file, and save the mailitem themself - complete with all
attachments - as msg-file too.
I've tried to detect the Application.SendItem-Event. This point of time
seems to be early, because some operations failed with Unknown Error.
- MailItem.Copy failed (with unknown error)
- Deleting Attachments and save Mailitem as msg-file works, but
- Discard changes by calling MailItem.Close(olDiscard) failed (with
unknown error)
Ok, next idea was to do the work later while monitoring Outbox-Folder.
In this case I've stored Id of each Mailitem when the
MAPIFolder.ItemAdd-Event occured. So, I was able to determine, which
Mailitem was removed, when the MAPIFolder.ItemAdd-Event was fired. But
the monitoring worked only, when outlook was not configured with option
"automatically send new emails". When this option is aktivated, then
MAPIFolder.ItemAdd-Event has no valid parameter (given MailItem is null).
Any idea?
Best regards
Darius
I'have written a COM add-in for Outlook using VC++. This COM-Addin
should detect new send mails. After sending a mail (with several
attachments) I have to separate all attachements from mailItem, then
save each attachment as a single file, save mailitem without attachments
as msg file, and save the mailitem themself - complete with all
attachments - as msg-file too.
I've tried to detect the Application.SendItem-Event. This point of time
seems to be early, because some operations failed with Unknown Error.
- MailItem.Copy failed (with unknown error)
- Deleting Attachments and save Mailitem as msg-file works, but
- Discard changes by calling MailItem.Close(olDiscard) failed (with
unknown error)
Ok, next idea was to do the work later while monitoring Outbox-Folder.
In this case I've stored Id of each Mailitem when the
MAPIFolder.ItemAdd-Event occured. So, I was able to determine, which
Mailitem was removed, when the MAPIFolder.ItemAdd-Event was fired. But
the monitoring worked only, when outlook was not configured with option
"automatically send new emails". When this option is aktivated, then
MAPIFolder.ItemAdd-Event has no valid parameter (given MailItem is null).
Any idea?
Best regards
Darius