Reputation: 761
I have Microsofr Office Professional Plus 2010 version 14.0.6029.1 installed. I have the following reference in a VB project:
Microsoft.Office.Enterop.Outlook
The type is .NET and the version id 14.0.0.0
My code includes the following:
Dim objOutlook As Outlook.Application
the following error appears:
"Error 14 Type 'Outlook.Application' is not defined. "
I'm stumped.
Upvotes: 5
Views: 22413
Reputation: 1
for 2016 excel version make sure the below is ticked:
tools-->references-----> *Microsoft outlook 16.0 object library, Microsoft Office 16.0 Object Library, Microsoft Access 16.0 Object Library.
Upvotes: 0
Reputation: 3322
I'm in the process of upgrading several projects from XP to Win7 as well, and I ran into this problem a few weeks back.
Try this,
Go to Project Properties -> References -> Add -> Click COM Tab -> Scroll down to either "Microsoft Outlook 14.0 Object Library" or "Microsoft Office 14.0 Object Library".
(Pretty sure it needs to be the Outlook one).
In my solution, when I right click on Dim objOutlook As Outlook.Application
and go to definition, it is a member of Microsoft.Office.Interop.Outlook
, which comes from the Microsoft.Office.Interop.Outlook DLL
This worked for me, so I hope it helps you.
Upvotes: 6
Reputation: 219047
Is there a namespace conflict with Outlook
that the code is perhaps trying to reference a different object?
Try aliasing your Imports
directive:
Imports Outlook = Microsoft.Office.Enterop.Outlook
This should explicitly tell your code (specifically your Dim
statement) to use that namespace instead of any other implied Outlook
namespace.
Upvotes: 0