ProcessPropertyChange not firing when expected

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

ProcessPropertyChange not firing when expected
 
nfsadx




Posts: 56
Joined: 2006-07-21

public class ItemEvents : ADXOutlookItemEvents
{
...
		
  public override void ProcessPropertyChange(string name)
  {
    //
  }

...
}


I have the above code which should fire every time an outlook field changes. The problem I have is with Subject and it occurs in the following scenario:

1) I have an adx OL form with various controls on it.
2) Subject is mandatory for my ADX application.
3) When a user clicks the button on my form to push data to our webservice, a check is done to see if Appointment.Subject is not null and it's length > 0 and the user is informed that they must enter a subject.
4) The user enters a subject by clicking in the subject field and entering some text.
5) If the user moves focus from the subject field back to the ADX form using the mouse, ProcessPropertyChange() DOES NOT FIRE and hence Appointment.Subject is still null.
6) However, if the user moves focus from the subject field to ANOTHER Outlook field, ProcessPropertyChange()does fire.

Can you advise on whether this is a bug please?
Posted 11 Oct, 2006 10:49:16 Top
Fedor Shihantsov


Add-in Express team


Posts: 1188
Joined: 2005-01-11
Hi,

This behavior is like clicking on another window (different from a current inspector). In this case the ProcessPropertyChange event does not fire up.

You can call the SaveCurrentItem method (see the code below) in the ADXOlForm.Activate event. As a result, the ProcessPropertyChange event will fire up.

private void SaveCurrentItem()
{
    object currentItem = null;
    try
    {
        currentItem = InspectorObj.GetType().InvokeMember("CurrentItem", System.Reflection.BindingFlags.GetProperty, null, InspectorObj, new object[] { });

        if (currentItem != null)
        {
            currentItem.GetType().InvokeMember("Save", System.Reflection.BindingFlags.InvokeMethod, null, currentItem, new object[] { });
        }
    }
    finally
    {
        if (currentItem != null)
        {
            Marshal.ReleaseComObject(currentItem);
        }
    }
}

private void ADXOlForm1_Activated(object sender, EventArgs e)
{
    SaveCurrentItem();
}
Posted 12 Oct, 2006 09:27:54 Top