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


Guest


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


Guest


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: 18810
Joined: 2006-05-11
Hello Mervin,

Here's a citation from https://social.msdn.microsoft.com/Forums/office/en-US/92108fcd-0993-48ec-860d-35c419856d39/how-can-i-determine-a-new-replyforward-messages-parent-mailitem-in-an-outlook-2010-cnet-addin?forum=outlookdev:

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.



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


Guest


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


Guest


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: 18810
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.


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