Hi All,
I have created a simple Windows Service which needs to be
able to send appointments to Outlook.
I have no problem makeing a reference to Microsoft
Outlook 11.0 Object Library and compiling the code. the
problem arises when I try to install the service using
installutil.
The error message I get is the following
Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Fiel or assembly name
Outlook, or one of its dependencies, was not found..
Any ideas anyone...please help !!!!
Here is the code.....
Microsoft.Office.Interop.Outlook.Application oApp = new
Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.NameSpace oNS =
oApp.GetNamespace("mapi");
if (password == "")
oNS.Logon(profile, Missing.Value, false, true);
else
oNS.Logon(profile, password, false, true);
Microsoft.Office.Interop.Outlook.AppointmentItem oAppt =
(Microsoft.Office.Interop.Outlook.AppointmentItem)
oApp.CreateItem
(Microsoft.Office.Interop.Outlook.OlItemType.olApp ointment
Item);
oAppt.Subject = subject;
oAppt.Body = content;
oAppt.Location = location;
oAppt.Start = startTime;
oAppt.End = endTime;
oAppt.ReminderSet = true;
oAppt.ReminderMinutesBeforeStart = 5;
oAppt.BusyStatus =
Microsoft.Office.Interop.Outlook.OlBusyStatus.olBu sy ; //
olBusy
oAppt.IsOnlineMeeting = false;
oAppt.Save();
oNS.Logoff();
oApp = null;
oNS = null;
oAppt = null; |