Support programmatic startup of Outlook in Enterprise Vault
Enterprise Vault Add-in for Outlook 2010 does not work if Outlook is started programatically through Microsoft APIs.
On a PC with the EV add-in installed and enabled:
- Start Microsoft Outlook programmatically (using the Microsoft Outlook published API) so that the Outlook User Interface is not visible (see example code below).
- Start the Microsoft Outlook User Interface normally from a shortcut.
The following problems are experienced in this scenario:
- The Enterprise Vault ribbon tab does not display.
- The Enterprise Vault option under the “File” tab also does not display.
- The add-in provided functions fail to operate through the Outlook UI as a result.
- Access to items stored in the users local Vault Cache become inaccessible through Microsoft Outlooks UI.
- Programmatic access to such items via the Outlook API generally fails with a COM Exception of the form: “System.Runtime.InteropServices.COMException (0x80040201): The operation failed. The messaging interfaces have returned an unknown error. If the problem persists, restart Outlook.”
- Symantec support state that this behaviour is not a bug and that programmatically starting Outlook is not supported in their add-in. Outlook’s API however, reports that the add-in is indeed loaded.
- If Outlook is started and then connected to programmatically, the Enterprise Vault add-in behaves normally.
The Enterprise Vault add-in should display its user interface elements and operate normally under the problem scenario described, i.e. in the same way that it operates when Outlook is started in the usual way from a shortcut without a programmatic start having been performed first.
Many commercial and departmental applications integrate with Microsoft Outlook in this way or through other supported Microsoft integration platform techniques. The current behaviour of the EV Add-In effectively renders the add-in unusable in such environments.
Create a simple Windows Forms application using Visual Studio; add the following code to, for example, a form button control click event handler.
Dim objOutlookApplication As Outlook.Application
objOutlookApplication = CreateObject("Outlook.Application")
Dim objNamespace As Outlook.NameSpace = objOutlookApplication.GetNamespace("MAPI")
Dim objFolder As Outlook.Folder
objFolder = objNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
Outlook.Application objOutlookApplication = default(Outlook.Application);
objOutlookApplication = Interaction.CreateObject("Outlook.Application");
Outlook.NameSpace objNamespace = objOutlookApplication.GetNamespace("MAPI");
Outlook.Folder objFolder = default(Outlook.Folder);
objFolder = objNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);