Activate Event on ADXOlForm

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

Activate Event on ADXOlForm
 
Nick Randolph




Posts: 14
Joined: 2007-02-13
In the previous version of the Addin Express .NET component we were able to attach event handlers to the activate and deactivate events of the ADXOlForm. In the current version although we can still attach event handlers they are no longer being triggered. For example we attach the deactivate event handler but when Outlook goes into the background the event doesn't trigger. Is this functionality no longer available?
Posted 26 Feb, 2007 02:56:35 Top
Fedor Shihantsov


Guest


Hello Nick,

Since Advanced Form region supports more than one ADXOlForm, we are planing to raise these events when switching between ADXOlForm in the same layout. I hope we will manage to implement this in two weeks.

Please, use the ADXOlForm.VisibleChanged event.

P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 26 Feb, 2007 08:43:57 Top
Nick Randolph




Posts: 14
Joined: 2007-02-13
Hmmm, I'm not sure that really helps. You have actually broken functionality that was working before. The deactivate event used to fire when outlook went into the background (eg when you use Alt-Tab to switch to another application). Similarly the activate event would fire when outlook was switched to.

The VisibleChanged event doesn't help as it is NOT raised when outlook is switched between - only when you switch forms etc within outlook.

We need this functionality so any assistance would greatly be appreciated.

Thanks

Nick
Intilecta - Premium level customer
Posted 26 Feb, 2007 20:34:09 Top
Fedor Shihantsov


Guest


Nick,

Please use Explorer.Activate/Deactivate events in the following way:

private void adxOutlookEvents_ExplorerActivate(object sender, object explorer)
{
    for (int itemIndex = 0; itemIndex < adxOlFormsManager1.Items.Count; itemIndex++)
    {
        for (int formIndex = 0; formIndex < adxOlFormsManager1.Items[itemIndex].FormInstanceCount; formIndex++)
        {
            if (adxOlFormsManager1.Items[itemIndex].FormInstances(formIndex).Active)
            {
                ADXOlForm1 form = adxOlFormsManager1.Items[itemIndex].FormInstances(formIndex) as ADXOlForm1;
                if (form != null)
                {
                    form.DoSomething();
                }
            }
        }
    }
}


BTW:
An active form in an advanced form region has Visible = true , Active = true
An inactive form in an advanced form region has Visible = true , Active = false
Posted 27 Feb, 2007 04:51:22 Top
Nick Randolph




Posts: 14
Joined: 2007-02-13
Fedor

Perhaps I haven't been clear enough on our requirements because this solution still doesn't address our issue. Our application needs to receive notification when the Outlook application is activate/deactivated. For example the user opens outlook (which runs our addin at startup which registers for activate/deactivate events). The user then switches (using Alt-Tab) to another application. Our application receives a deactivate event letting it know that Outlook is no longer in focus/being used. When the user returns to Outlook our application receives an activate event letting it know the user is once again using Outlook.

In the previous version of the addin this could be achieved using the activate/deactivate events on the ADXOlForm form. We only wanted to subscribe for these events when our form is visible in outlook so this made sense. However, if we need to add global event handlers for the Outlook application that would be ok as well. Please let us know where we should attach event handlers in order to receive notification when outlook is activate/deactivated
Posted 27 Feb, 2007 18:33:40 Top
Fedor Shihantsov


Guest


Nick,

Please, right click on the AddinModule and open the 'Add Events' dialog. Check the 'Microsoft Outlook Events' item. So, you can use the ADXOutlookAppEvents component to handle Outlook events including ExplorerActivate, ExplorerDeactivate.
Posted 28 Feb, 2007 05:28:48 Top
Nick Randolph




Posts: 14
Joined: 2007-02-13
Fedor - My apologies I think I misunderstood you when you were talking about the Explorer events. I have followed your instructions and they seem to provide us with the necessary events. Thanks for your assistance
Posted 28 Feb, 2007 20:23:34 Top