_ItemChange fires, when Item_Open is performed

  • Thread starter sledge via OfficeKB.com
  • Start date
S

sledge via OfficeKB.com

Hello,

This happens as follows:
I create an item of my custom form (task) in some task (non-default) folder.

I want to create a copy of it in Personal Tasks (default Tasks) and to make
it ordinary -- IPM.Task. Thus I simply do it via CDO (to avoid code run):
Set cdoCopied = cdoItem.CopyTo(..personal forms...)

I also monitor Personal Tasks folder for any Items_ItemChange event and
then perform other necessery tasks.
The strangest thing is, that this event (ItemChange) is FIRED, when I open
that copied Item (doubleclick). I do not save anything, I just open it.
Nothing is Changed... So, why does this event fire? (it does not fire
during all successive openings, and with all other Tasks).

The temporary workaround is as follows:

If Application.Inspectors(Application.Inspectors.Count).CurrentItem.EntryId
= Item.EntryId Then
Exit Sub ' as inspector is being already shown..

Though this method is not 100% (to my mind).. There may be other
No code is run within that item's opening (it's messageclass is definately
"IPM.Task"!). Why does this weirdness happen then?..

Thank You for a hope in help :)
 
S

sledge via OfficeKB.com

on-fly corrections:
Set cdoCopied = cdoItem.CopyTo(..personal tasks...)

I even tried doing folPersonalTasks.Add("IPM.Task") ' and then remapping
all properties...

I also surely do all those
.MessageClass = "IPM.Task"
to make sure, this item becomes ordinary
 
Top