I am trying to create an Outlook 2003 add-in using Visual Studio 2008 on Windows XP SP3 and Internet Explorer 7.
My add-in uses the custom home page of the folder, which displays my custom form, which includes control over the look of Outlook.
I get a COM Exception with a description of "Exception from HRESULT: 0xXXXXXXXX" every time I try to set the Folder property for OVC. The error code is a random number, each time a different one. This is not the first access to control properties; before that, the View and ViewXML properties are already set. The control is marked as safe for scripting.
I am using the value of the CurrentFolder.FolderPath property of the active explorer, which seems to be correct:
Outlook.Explorer currentExplorer = app.ActiveExplorer(); if (currentExplorer != null) { ovcWrapper.Folder = currentExplorer.CurrentFolder.FolderPath; }
This is the top of the stack trace:
System.Runtime.InteropServices.COMException (0xXXXXXXXX): Exception from HRESULT: 0xXXXXXXXX at Microsoft.Office.Interop.OutlookViewCtl.ViewCtlClass.set_Folder(String pVal) at AxMicrosoft.Office.Interop.OutlookViewCtl.AxViewCtl.set_Folder(String value)..
This only happens if the folder is in a different .pst file. Going to the folder inside the PST file by default will not throw an exception.
I must emphasize that everything went perfectly before I went on vacation :). Windows XP seems to have installed some updates that by default changed the protection of Internet Explorer or Outlook 2003 while I was away.
On the other hand (virtual machine), everything works fine with Office 2007 and Internet Explorer 6 without any updates.
source share