On AddInModule.adxOutlookAppEvents1ItemSend - determine different statuses

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

On AddInModule.adxOutlookAppEvents1ItemSend - determine different statuses
Would like to determine the type of event (newmail, reply, replyall) 
Mervin Pearce




Posts: 26
Joined: 2005-12-06
I need some pointer to only trigger when the type of event inside the TAddInModule.adxOutlookAppEvents1ItemSend is a 'NewMail' being sent. When the user does a Reply or ReplyAll, I need to NOT perform some actions inside the event. It is only on a NewMail which I would like to trigger my funnction.

procedure TAddInModule.adxOutlookAppEvents1ItemSend(ASender: TObject; const Item: IDispatch; var Cancel: WordBool);
if Outlookapp.Inspectors.Count > 0 then
begin
// Only on Sending NewEmail trigger code.
end;

Regards
Mervin
Posted 20 Nov, 2015 01:53:30 Top
Mervin Pearce




Posts: 26
Joined: 2005-12-06
It seems I can get a 'cheat' here and use it in a test environment.

the procedure TAddInModule.adxOutlookAppEvents1ExplorerInlineResponse(ASender: TObject; const Item: IDispatch);

is triggered on a reply, replyall and a forward and NOT on a new mail

I can set a global variable which can be read when the send occurs finally. Will update as I see there was a previous request on something similar.
Posted 20 Nov, 2015 03:15:44 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Hello Mervin,

Here's a citation from How can I determine a new Reply/Forward message's parent MailItem:

A reply or forward message should have ConversationIndex and ConversationTopic properties that aren't null or null string. It will also have Saved = false when it opens.


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Nov, 2015 03:40:31 Top
Mervin Pearce




Posts: 26
Joined: 2005-12-06
My code work with the cheat, however. On a new meeting request sending the mail it is not a _MailItem as it says 'interface not supported'. Where do I find all the constant information. Cannot find it in the documentation.

For example _MailItem, what are all the other attributes/dispatchers?
Posted 25 Nov, 2015 05:02:32 Top
Mervin Pearce




Posts: 26
Joined: 2005-12-06
Objective is to determine when I am only sending a new mail should the sendevent be triggered. Not in a meeting request.
Posted 25 Nov, 2015 05:43:37 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Hello Mervin,

Then you only need to check for _MailItem; use QueryInterface. All the other _*Item interfaces are listed in the Outlook type library.

Mervin Pearce writes:
Cannot find it in the documentation.


This is part of the Outlook object model, not Add-in Express.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 25 Nov, 2015 06:54:34 Top