Sagi
Guest
|
We've noticed ProcessAttachmentAdd isn't fired when more than 1 inspector windows are open.
We've investigated it on our side and it looks like addin-express is managing its own connections for ADXOutlookItemEvents
Is it possible that a connection is closed on addin-express side once a new inspector is opened?
To our understanding all open inspectors should have a valid connection until closed.
Thanks |
|
Andrei Smolin
Add-in Express team
Posts: 18821
Joined: 2006-05-11
|
Hello Sagi,
I may misunderstand what you see but I see that the main assumption is wrong. ADXOutlookItemEvents is a separate class. You create an instance of that class and connect it to an Outlook item e.g. to MailItem. Getting events from several items requires several instances of the ADXOutlookItemEvents class.
If you only get events from the currently active inspector, this requires one instance plus code that reconnects that instance to the item, the inspector of which becomes active. "Reconnects" means, you need to disconnect the class from the previously active item and connect it to the currently active one. You do this when an inspector becomes active; see InspectorActivate. Also, you need to disconnect the ADXOutlookItemEvents instance if the user activates an Outlook Explorer window; see ExplorerActivate. At the moment I can't remember whether other cases exists but, if you find them, you use the same approach: a single ADXOutlookItemEvents instance exists and it connects to the active inspector; if there are no inspectors, that instance should be disconnected.
Andrei Smolin
Add-in Express Team Leader |
|
Sagi
Guest
|
Andrei Smolin writes:
If you only get events from the currently active inspector, this requires one instance plus code that reconnects that instance to the item, the inspector of which becomes active. "Reconnects" means, you need to disconnect the class from the previously active item and connect it to the currently active one. You do this when an inspector becomes active; see InspectorActivate. Also, you need to disconnect the ADXOutlookItemEvents instance if the user activates an Outlook Explorer window; see ExplorerActivate. At the moment I can't remember whether other cases exists but, if you find them, you use the same approach: a single ADXOutlookItemEvents instance exists and it connects to the active inspector; if there are no inspectors, that instance should be disconnected.
You are right. and we do connect to the item on AppEvents_ExplorerActivate and AppEvents_InspectorActivate and I can see the connection succeeded, yet, we don't get the ProcessAttachmentAdd CB in this case. Is it possible that the activate event is fired after the attachment event happens? |
|
Andrei Smolin
Add-in Express team
Posts: 18821
Joined: 2006-05-11
|
Sagi writes:
Is it possible that the activate event is fired after the attachment event happens?
I don't know. But years with Office teach us: don't surprise.
Andrei Smolin
Add-in Express Team Leader |
|