On Change Item Event

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

On Change Item Event
OnChangeItemEvent 
Dmitry Kostochko


Add-in Express team


Posts: 2830
Joined: 2004-04-05
Hi Charles,

1) I don't think it is complex. This is a standard routine.
2) I am afraid I do not quite understand you. Doesn't it work?
3) I don't think the Task.OnPropertyChange fires itself unless you changed the TaskItem inside the OnPropertyChange event handler.
4) You can "mark" it, e.g. by adding a unique UserProperty item.

Posted 01 Dec, 2005 07:54:22 Top
charles van den akker III




Posts: 10
Joined: 2005-11-22
Hi Dmitry...


1) OK.. Tx
2) I use dialogs to debug... and that casued the events to fire continuously...
3) When you make a change to an open item the OnPropertyChange event fires as the change is made... once you save the item the OnChange event is fired... so you can gather all the fields that that are changed to then filter your OnChange event.
4) same as "2)"...

(thanx again dude)

Next queries...



1)Why when i load the events to my Inbox or SentMail do i get a message that my system is out of memory... there are about 900 entries in each folder....

any suggestions?

this is how i load the events
{need to separate the Item events from the folder because when i add a new item i need to load the events to that item too...[am i correct?]}

Using Delphi 7 Ent... and Office 2000 SR-1 (9.0.0.3821)...WindowsXP Pro version 2002 SP2...


[CODE]
procedure SetFolderOnPropertyChange(const AFolder: MAPIFolder);
var
i, Count: Integer;
IDsp: IDispatch;

begin
if Assigned(AFolder) then begin
Count := AFolder.Items.Count;
for i := 1 to Count do begin
IDsp := AFolder.Items.Item(i);
if Assigned(IDsp) then
try
SetItemOnPropertyChange(iDsp);

finally
IDsp := nil;
end;
end;
end;
end;

//.....

procedure SetItemOnPropertyChange(const Item: IDispatch);
var
ItemMail: TMailItem;
begin
if Item.QueryInterface(IID__MailItem, IMail) = S_OK then
if Assigned(IMail) then
begin
try
ItemMail := TMailItem.Create(nil);
ItemMail.ConnectTo(IMail);

ItemMail.OnCustomPropertyChange := DoCustomPropertyChange;
ItemMail.OnPropertyChange := DoPropertyChange;

finally
IMail := nil;
ItemMail.Free;
end;
end;
end;


2) i am struggling with using a button on the inspectors...
if a customField has a value the caption should be different to if there is no value..

Thanx again dude...
your brain must bubble with all the activity...
Posted 06 Dec, 2005 01:47:55 Top
Dmitry Kostochko


Add-in Express team


Posts: 2830
Joined: 2004-04-05
Hi Charles,

First, I would recommend you installing the latest service packs on your MS Office 2000. MS guys fixed a lot of bugs there.

1) Can you send me your code please? I will test it on our test PCs and let you know about the results.

2) I think you need to trap the OnInspectorActivate event and set the Caption of your button there.

Posted 06 Dec, 2005 07:24:58 Top