Question about MAPI Store Accessor Sample

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

Question about MAPI Store Accessor Sample
 
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hello Moritz,

Also I wonder why the OnObjectMoved and OnObjectCopied events are fired, even though they were not enabled in SupportedStoreEvents?!


I opened a sample add-in project you mentioned earlier and see the SupportedStoreEvents property of the MAPI Store ACcessor component. It has the following values: ObjectCreated, ObjectMoved and ObjectCopied. Am I right? Please correct me if I was wrong.

If I understood that right this means that the corresponding events are only fired for the folder to which the events are connected, right?!
In my tests the events are fired for the connected folder but also for the inbox every time!? Is this correct?


Yes, you are absolutely right. That is not correct. Moreover, I can't reproduce such behavior on my computer. Could you please share your desktop to me?

The next question is, how can I connect the events to more than just one folder because I want to monitor multiple folders on various “levels” without recursive in the store. I tried creating multiple ItemsEvents objects in a list and connecting one folder per itemsEvents but it looks like this causes that no events are fired at all (except inbox again).


In that case you need to pass true as a third parameter to the ConnectTo method. And in the MAPI Store Accessor event handlers you need to check out subfolders of the FolderObj recursively too.

And the last...

I’m not sure what to think about this because working with the IDs would be safer (and the cached mode is recommended by Microsoft anyway) so…


I fully understand and support you about that. But the MAPI subsystem returns completely different entry id in case of non-cached exchange mode. I have checked it out in the OutlookSpy utility.

You are welcome, Moritz :-)
.NET, Extended MAPI, Windows Phone & RT
Posted 29 Jul, 2010 05:27:28 Top
Zing




Posts: 35
Joined: 2010-02-24
I opened a sample add-in project you mentioned earlier and see the SupportedStoreEvents property of the MAPI Store ACcessor component. It has the following values: ObjectCreated, ObjectMoved and ObjectCopied. Am I right? Please correct me if I was wrong.

I disabled ObjectMoved and ObjectCopied and the events where still fired.
Yes, you are absolutely right. That is not correct. Moreover, I can't reproduce such behavior on my computer. Could you please share your desktop to me?

Sure, if you tell me how I can contact you? Like mentioned, I have several ways to share my screen
In that case you need to pass true as a third parameter to the ConnectTo method. And in the MAPI Store Accessor event handlers you need to check out subfolders of the FolderObj recursively too.

So there is no chance to for example monitor two different folders on the same level (or somewhere in the store) independently?

And finally, since you are MAPIMaster ;-) Any idea if the cached mode status can be read from somewhere?
Posted 29 Jul, 2010 06:36:19 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
1. and 2. For the remote session we can use the TeamViewer, for example. Please use our support e-mail address to send the required credentials to me.

3. The solution is very simple: to monitor two Outlook folders you need to create separate instances of the OutlookItemsEventsClass class.

Finally...

Please navigate to the following hive in the windows registry: HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\[ProfileName]\13dbb0c8aa05101a9bb000aa002fc45a and find the 00036601 (REG_BINARY) key. You can play with cached exchange mode option in the Mail profile and see its corresponding value in the windows registry. On my PC I see the following:

1. 84 01 00 00 - enabled cached exchange mode
2. 84 05 00 00 - enabled cached exchange mode with Public Folders/Favorites
3. 04 10 00 00 - disabled cached exchange mode
.NET, Extended MAPI, Windows Phone & RT
Posted 29 Jul, 2010 09:30:38 Top