469,282 Members | 1,637 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Outlook from ASP.NET

Hi,

I am trying to set an appointment from my ASP.NET
intranet web-site.
The following code works fine when used from a console
application but when used in an asp.net web-site I get
Access Denied error.

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");
oNS.Logon("WAkthar",
Missing.Value, false, true);

Outlook.AppointmentItem oAppt = (Outlook.AppointmentItem)
oApp.CreateItem(Outlook.OlItemType.olAppointmentIt em);

oAppt.Subject = "Subject";
oAppt.Body = "Content";
oAppt.Location = "Location";

oAppt.Start = Convert.ToDateTime("13/12/2004 9:00:00 AM");
oAppt.End = Convert.ToDateTime("13/12/2004 1:00:00 PM");

oAppt.ReminderSet = true;
oAppt.ReminderMinutesBeforeStart = 5;
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy;
oAppt.IsOnlineMeeting = false;

oAppt.Save();
oNS.Logoff();

oApp = null;
oNS = null;
oAppt = null;
Does anyone have any ideas???
Nov 18 '05 #1
4 3416
Off the top of my head, the console app runs as you, the asp .net process
doesn't. More importantly don't use outlook in asp.net it can really kill
your server.
Nov 18 '05 #2
keep in mind that asp.net run on the server machine and not the client
computer. Any processing you do, will occur on the host machine. This could
be related to the issue you are having. To make use of the clients'
computer, you would have to user like a activeX control or java applet.

"W Akthar" wrote:
Hi,

I am trying to set an appointment from my ASP.NET
intranet web-site.
The following code works fine when used from a console
application but when used in an asp.net web-site I get
Access Denied error.

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");
oNS.Logon("WAkthar",
Missing.Value, false, true);

Outlook.AppointmentItem oAppt = (Outlook.AppointmentItem)
oApp.CreateItem(Outlook.OlItemType.olAppointmentIt em);

oAppt.Subject = "Subject";
oAppt.Body = "Content";
oAppt.Location = "Location";

oAppt.Start = Convert.ToDateTime("13/12/2004 9:00:00 AM");
oAppt.End = Convert.ToDateTime("13/12/2004 1:00:00 PM");

oAppt.ReminderSet = true;
oAppt.ReminderMinutesBeforeStart = 5;
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy;
oAppt.IsOnlineMeeting = false;

oAppt.Save();
oNS.Logoff();

oApp = null;
oNS = null;
oAppt = null;
Does anyone have any ideas???

Nov 18 '05 #3
Can I not do this via .NET ??

-----Original Message-----
keep in mind that asp.net run on the server machine and not the clientcomputer. Any processing you do, will occur on the host machine. This couldbe related to the issue you are having. To make use of the clients'computer, you would have to user like a activeX control or java applet.
"W Akthar" wrote:
Hi,

I am trying to set an appointment from my ASP.NET
intranet web-site.
The following code works fine when used from a console
application but when used in an asp.net web-site I get
Access Denied error.

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");
oNS.Logon("WAkthar",
Missing.Value, false, true);

Outlook.AppointmentItem oAppt = (Outlook.AppointmentItem) oApp.CreateItem(Outlook.OlItemType.olAppointmentIt em);

oAppt.Subject = "Subject";
oAppt.Body = "Content";
oAppt.Location = "Location";

oAppt.Start = Convert.ToDateTime("13/12/2004 9:00:00 AM"); oAppt.End = Convert.ToDateTime("13/12/2004 1:00:00 PM");
oAppt.ReminderSet = true;
oAppt.ReminderMinutesBeforeStart = 5;
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy;
oAppt.IsOnlineMeeting = false;

oAppt.Save();
oNS.Logoff();

oApp = null;
oNS = null;
oAppt = null;
Does anyone have any ideas???

.

Nov 18 '05 #4

"W Akthar" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
Can I not do this via .NET ??


You can if you use a client side control like Tampa .Net suggests.

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Fritz Switzer | last post: by
10 posts views Thread by John | last post: by
3 posts views Thread by John | last post: by
8 posts views Thread by Li Pang | last post: by
3 posts views Thread by wizzbangca | last post: by
4 posts views Thread by Brian Hampson | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.