FileNotFoundException while trying to create an instance of Outlook ApplicationClass



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

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

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 **************



Assembly Version:

Win32 Version: 11.0.5530


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.


I'm having the same problem with C#.

Did you find a solution to your problem??



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

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.



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.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question