FileNotFoundException while trying to create an instance of Outlook ApplicationClass

  • Thread starter Thread starter gulzar
  • Start date Start date
G

gulzar

Hi All,

I am getting FileNotFoundException while trying to create an instance
of Outlook::ApplicationClass().
This was done in VC++.Net. This happens only in some of the user's
systems. They had 2003 PIAs installed on their machines from Office
2003 cd. We are also not redistributing the 2003 PIAs as suggested by
Micorsoft.

Environment - Windows XP Pro, Office 2003, Outlook 2003 PIAs

Code -
using namespace Microsoft::Office::Interop;
private: Outlook::ApplicationClass __gc *oApp;
private: System::Void InitializeOutlook()
{
oApp = new Outlook::ApplicationClass();
oNS = oApp->Application->GetNamespace("mapi");
oNS->Logon(Missing::Value, Missing::Value, __box(true), __box(true));
}

This is the truncated stack trace of the exception.

************** Exception Text **************
System.IO.FileNotFoundException: The specified module could not be
found.

at SCToolbar.OptionsDlg.InitializeOutlook()

at SCToolbar.OptionsDlg.LoadData()

at SCToolbar.OptionsDlg..ctor(ToolbarOptions tbarOptions)

at SCToolbar.SCToolbarControl.DisplayOptions()

at SCToolbar.SCToolbarControl.optionsButton_Click(Object sender,
EventArgs e)


************** Loaded Assemblies **************

----------------------------------------

Microsoft.Office.Interop.Outlook

Assembly Version: 11.0.0.0

Win32 Version: 11.0.5530

CodeBase:
file:///c:/windows/assembly/gac/microsoft.office.interop.outlook/11.0.0.0__71e9bce111e9429c/microsoft.office.interop.outlook.dll


As you can see, in the list of loaded assemblies, there is
Microsoft.Office.Interop.Outlook assembly from GAC. I have no clue
which file is actually missing here.

Please help me.
Regards,
Gulzar
 
Not yet really. I suspect this might be due a bad installation I once
shipped. That one had 2003 PIAs along with it (courtesy Install
Shield). So, when they uninstalled, 2003 PIAs were also removed or
corrupted.

Next time, as per Microsoft recommendation, I removed the 2003 PIAs
while packaging the installation, which resulted in this error. So, it
was somehow not able to find the PIAs already installed in that box.

To rectify this, I had to ask users (fortunately few of them) to
reinstall 2003 PIAs, or even worse Outlook 2003 itself in some cases.
That solved the problem.

So, I feel this happens in those systems where PIAs are corrupted, even
though not exactly missing. I am still not sure how we can solve it
from the application itself if this happens again.

Regards,
Gulzar
 
I had to uninstall MS Office 2003 and then do a full install on it and it
worked fine for me.

Now I just have to figure out if what I want to do is possible or not. :)

Thanks for all of your help Gulzar.

-G
 
Back
Top