how to Catch the "color category change"

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

how to Catch the "color category change"
 
Yossi Mazal Tov


Guest


is there any event?
is there search in explorer change?

Thanks
Yossi
Posted 08 Jun, 2015 12:58:52 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Yossi,

Changing a color category on an item produces a PropertyChange event on the item; the Name parameter of the event handler contains the string "Categories" in this case.

Yossi Mazal Tov writes:
is there search in explorer change?


Sorry, I don't understand. Could you please rephrase?


Andrei Smolin
Add-in Express Team Leader
Posted 09 Jun, 2015 04:55:59 Top
Yossi Mazal Tov


Guest


can you be more specific. i search all the events in the outlookeventapp or addinmodel event and didn't find any event to catch the "on category color change".
not global and not on the item events.

Yossi
Posted 09 Jun, 2015 08:21:14 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
The event is called PropertyChange, see https://msdn.microsoft.com/EN-US/library/office/ff866739.aspx. It occurs for every property changed (e.g. Subject). The property changed is supplied in the Name parameter of the event handler; in your case, this parameter contains the string "Categories".


Andrei Smolin
Add-in Express Team Leader
Posted 09 Jun, 2015 08:26:50 Top
Yossi Mazal Tov


Guest


hi andrei.
i read this artical, but i can't implemnt it to DELPHI.
do you have any EXAMPLE that use this event in delphi?
how do i connect the procedure event that i have to write to the outlookapp object?

Yossi
Posted 09 Jun, 2015 09:45:34 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Here's a raw sketch:

procedure TAddInModule.DoSomething(ASender: TObject;
  const Inspector: _Inspector);
var
  Mail: _MailItem;
begin

    Inspector.CurrentItem.QueryInterface(IID__MailItem, Mail);
    if Assigned(Mail) then
      try
        FMail := TMailItem.Create(nil);
        FMail.ConnectTo(IMail);
        FMail.OnPropertyChange := DoPropertyChange;
      finally
        IMail := nil;
        oleNamespace := UnAssigned;
      end;
    end;
end;

procedure TAddInModule.DoPropertyChange(ASender: TObject;
  const Name: WideString);
begin
//  check Name
end;



Andrei Smolin
Add-in Express Team Leader
Posted 09 Jun, 2015 10:04:58 Top