cancel
Showing results for 
Search instead for 
Did you mean: 

EV Outlook Add-In - Detecting emails archived by EV

Carlos_Castro
Level 4

Hi everyone,

I would like to write an Outlook add-in in C# that is able to detect if a given email is stored in exchange or in enterprise vault. Is there some way I can detect the difference from my add-in code? 

This should be possible since outlook and EV plugin know where each email is, so they must be tagged in some way.

Thanks for your help!!! Please let me know if further information or clarifications are needed.

Carlos

1 ACCEPTED SOLUTION

Accepted Solutions

Ben_Heymink
Level 4
Employee

Here you go Carlos, I've wrote about the steps you need to take here. Included in the post is a link to some code which should do what you want. Let me know if you need any help, and happy developing!

View solution in original post

29 REPLIES 29

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

If by "a given email is stored in exchange or in enterprise vault" you mean if it's a shortcut or not, the message class will be that of a shortcut (IPM.note.enterprisevault.shortcut) otherwise it'll be something else.

Carlos_Castro
Level 4

Hi AndrewB, thanks for your answer.

So if the message class is IPM.note.enterprisevault.shortcut I will be certain that it is an EV shortcut? great!

Quick question, where can I find documentation about that? How did you find out this?

Thanks

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

if you look at the properties of the message in outlook you'll be able to see what the message class is. you can also sort your mailbox by message class and see that all of the EV shortcuts are different from your other types of messages.

Carlos_Castro
Level 4

For example, within the context of the code below, the mailItem  a System._ComObject - how would I determine it's class, and wether it is a IPM.note.enterprisevault.shortcut object?

Outlook.MAPIFolder inbox = this.application.ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

dynamic mailItem = inbox.Items.GetFirst(); //how get class of mailItem to detect Enterprise vault?

Thanks

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

the best i can do is give you the theoretical information since i'm not a developer. perhaps someone else on the forum knows how to code what you're asking for.

JesusWept3
Level 6
Partner Accredited Certified

Not really sure whether we should be going in to coding.
But honestly its going to be like Andrew said, use IPM.Note.EnterpriseVault*
other than that, break out outlook spy and look at the different mapi properties EV stamps on any given message

Anywho:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._mailitem.messageclass.aspx

https://www.linkedin.com/in/alex-allen-turl-07370146

Carlos_Castro
Level 4

Great, thanks for the answers - I'll give it a try and update.

Ben_Heymink
Level 4
Employee

Don't go writing an Enterprise Vault add-in and putting me out of a job! ;) That said, I'll look at writing up a simple C# application and putting the example code on my personal site if you would like?

Carlos_Castro
Level 4

Hi Ben,

That would be great! My intention is to have both EV add-in and my own add-in so don't worry about your job :)

Thanks!

Carlos_Castro
Level 4

To clarify, what I want to do, is on the startup of my add-in, do something like the following

Foreach email in Inbox

    if IsEnterpriseVaultShortcut(email) then

           //do something

     else

            //do something else

and the question is how to implement the IsEnterpriseVaultShortcut routine in a C# outlook add in

Rob_Wilcox1
Level 6
Partner

It is worth remembering that if you use this model, then you will hit :

 

http://msdn.microsoft.com/en-us/library/office/aa210946(v=office.11).aspx

 

A 'security' pop-up if/when you access particular properties:

 

You receive the confirmation dialog box when a solution tries to programmatically access the following properties of the MaiItem object:

  • SentOnBehalfOfName
  • SenderName
  • ReceivedByName
  • ReceivedOnBehalfOfName
  • ReplyRecipientNames
  • To
  • CC
  • BCC
  • Body
  • HTMLBody
  • Recipients
  • SenderEmailAddress

 

 

Also on that same page is a reference to the MessageClass property...  which is what you are after to determine if an EMAIL is a shortcut or not...

 

http://msdn.microsoft.com/en-us/library/office/aa171490(v=office.11).aspx

 

Remember though that not all items are turned in to shortcuts after archiving - like calendar items, tasks and so on.

Working for cloudficient.com

Rob_Wilcox1
Level 6
Partner

Hi reply too soon.. because of the security dialog, you could look in to something like the Redemption library.  There is an example of it's use here by me:

 

http://www.symantec.com/connect/downloads/contacts-checker-enterprise-vault

Working for cloudficient.com

Ben_Heymink
Level 4
Employee

Here you go Carlos, I've wrote about the steps you need to take here. Included in the post is a link to some code which should do what you want. Let me know if you need any help, and happy developing!

Carlos_Castro
Level 4

Hi Ben, thanks for the effort of writing the code! great article by the way, I'm sure it will help other people as well.

Rob, thank you very much for the clarifications. 

I'll give it a try and mark as answered so other people can use the question as reference.

Jim_Nolan
Not applicable

Which version of Outlook are you using 2003, 2007 or 2010?

Carlos_Castro
Level 4

Do you think this will work in both EV 9 and EV 10?

JesusWept3
Level 6
Partner Accredited Certified

It will work with any version of EV.
Like rob said though, you can use Redemption and the SafeMailItem to avoid any security warnings/pop ups.
Only thing to note though is that it is possible to have items archived by EV that aren't a shortcut.

So for instance if you have a policy that says dont create shortcut, don't delete the original item, it will be archived and exist in the users archive and the item in the mailbox is left seemingly untouched but EV does add properties so that it doesn't keep getting re-archived

https://www.linkedin.com/in/alex-allen-turl-07370146

Ben_Heymink
Level 4
Employee

Do you mean my sample code? Sure, no reason why it shouldn't work accross all versions, our custom message class hasn't changed in ages. 

Rob_Wilcox1
Level 6
Partner

You're welcome.

Working for cloudficient.com