Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use Microsoft.office.Interop
#1
Hi, 

i try to learn how to use LibreAutomate and i'm stuck for a single test ... 

 
Code:
Copy      Help
/*/ nuget -\Microsoft.Office.Interop.Outlook; /*/

using Microsoft.Office.Interop.Outlook;
using Outlook = Microsoft.Office.Interop.Outlook;

Outlook.Application Application = new Outlook.Application();
Outlook.Accounts accounts = Application.Session.Accounts;

foreach (Outlook.Account account in accounts)
{
Console.WriteLine(account.DisplayName);
}

return;

and i have this error message :
Script1.cs(2,27): error CS0234: The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Script1.cs(1,17): error CS0234: The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

i have try to insert the lib in properties but i m stuck can you help me ?

also, i m not a Visual Studio user and with your install the nuget file config was not set ...
you should probably add an initial file if %AppData%\NuGet\NuGet.config does not exist with nuget.org into .
#2
Is it installed in menu Tools -> NuGet?
#3
Nuget is in the install without "source" by default and we can't add source with this gui.
that  was my first time with  nuget and i have installer visual studio for add new source before download a package.
( now i know how to make in cmd line but in your install you should verify source )
#4
@alsk, I just saw this. Your code runs for me without issue after I installed from Properties, as shown below the code.
 
Code:
Copy      Help
/*/ com Outlook 9.6 #ed6988d3.dll; com stdole 2.0 #5213fb64.dll; com Office 2.8 #29f388b5.dll; /*/
I installed it by going to Properties -> Com, and selecting "Microsoft 16.0, 9.6".
I know this was posted a long time ago, sorry (just joined).
Regards,
burque505


Forum Jump:


Users browsing this thread: 1 Guest(s)