This project has moved. For the latest updates, please go here.

Referencing Outllook API

Sep 15, 2013 at 11:14 PM
Hi,
I am facing problems with my code which is using the "OutlookAPI.dll","OfficeAPI.dll" and "NetOffice.dll" for working with my application using Outlook. THE REASON I AM USING NETOFFICE IS FOR BACKWARD COMPATIBILITY WITH DIFFERENT VERSIONS OF OUTLOOK.

I am currently using the below code
__Outlook.Application Outlook = Outlook.Application Outlook = null;
which doesnt compile after referencing the above dll's.

My app was earlier using the "Microsoft.Office.Interop.Outlook.dll".
Kindly help as I need to get this fixed as this earliest

Regards
Gurudatt
Coordinator
Sep 15, 2013 at 11:24 PM
hey man i need the specific error message to help you. :)
(in case of 'cant embedd...' set the NetOffice reference properties 'embedd interop types to false)
Sep 16, 2013 at 12:04 AM
Hi sabastian, thanks for the reply
I am currently refereing the 3 DLL's - "OutlookAPI.dll","OfficeAPI.dll" and "NetOffice.dll" and using the below code

using OfficeApi.Utils;
...
...
...
Outlook.Application _Outlook = null;
Outlook.MailItem mi = null;
_Outlook = new Outlook.Application();
Outlook.Explorer oExplorer = _Outlook.ActiveExplorer();
Outlook.Selection oSelection = oExplorer.Selection;
...
...
mi = (Outlook.MailItem)item;

I am getting an error - "The type or namespace name 'OfficeApi' could not be found (are you missing a using directive or an assembly reference?)"

Kindly Help as I need to complete the application within the next 2 hours for release. Sorry for all the trouble

Regards
Gurudatt
Sep 16, 2013 at 1:26 AM
Hi,
I have also used the below code

using Outlook = NetOffice.OutlookApi;
using Office = NetOffice.OfficeApi;

and referenced the 3 DLL's - "OutlookAPI.dll","OfficeAPI.dll" and "NetOffice.dll", but i am getting the error "The type or namespace name 'NetOffice' could not be found (are you missing a using directive or an assembly reference?)"

Regards
Gurudatt
Sep 16, 2013 at 1:35 AM
Hi Sabastian,
Forgot to mention that i have downloaded the entire source code and checked the examples. even they have the "Missing Reference" error. Kindly help

Thanks and Regards
Gurudatt
Coordinator
Sep 17, 2013 at 11:10 AM
did you try the examples in the 1.6 release? can you tell me your .net framework version?
Sep 17, 2013 at 10:25 PM
The DLL's are from the 1.6 release of CodePlex NetOffice. The framework that I am using is DotNet 4.5. I have referenced the 3 DLL's - "OutlookAPI.dll","OfficeAPI.dll" and "NetOffice.dll" of v1.6. Below is my code

using Outlook = NetOffice.OutlookApi;
using Office = NetOffice.OfficeApi;

...
...
...
Outlook.Application _Outlook = null;
Outlook.MailItem mi = null;

_Outlook = new Outlook.Application();
Outlook.Explorer oExplorer = _Outlook.ActiveExplorer();
Outlook.Selection oSelection = oExplorer.Selection;
...
...
mi = (Outlook.MailItem)item;

I am getting an error - "The type or namespace name 'OfficeApi' could not be found (are you missing a using directive or an assembly reference?)"
I have also checked the examples provided in the v1.6 download. Even they have the "Missing Reference" error. Kindly help

Thanks and Regards
Gurudatt
Mar 31, 2014 at 11:02 PM
Has anyone found a solution, I just downloaded the samples and I get the same error. I've removed the references and added them back in but did not work. Any suggestions.

Cheers
Coordinator
Apr 1, 2014 at 5:26 PM
when its possible, please send me a minimalistic sample project(including NO assemblies) to public.sebastian[at]web.de
i want clearify the problem.

*Sebastian