|
-
Oct 14th, 2004, 05:42 PM
#1
Thread Starter
Banned
asp.net / vb.net dope why o why outlook
Trying to send Outlook tasks from asp/vb.net web app and I have this:
VB Code:
Imports Microsoft.Office.Interop.Outlook
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objOutlook As Microsoft.Office.Interop.Outlook.Application
Dim objTask As TaskItem
objOutlook = New Microsoft.Office.Interop.Outlook.Application
objTask = objOutlook.CreateItem(OlItemType.olTaskItem)
objTask.Recipients.Add("ssmith")
objTask.Subject = "Test"
objTask.Body = "This is the body"
objTask.Assign()
objTask.Send()
End Sub
End Class
But right when i say objOutlook = New....
I get an error:
Code:
Exception Details: System.UnauthorizedAccessException: Access is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
I tried everything...What the hell is this error. What file????!?!?!?
I tried to go to the reference itself:
C:\Program Files\Microsoft Office\OFFICE11\MSLOut.olb
I right clicked and added every frigging user in our company ...still no luck...gave them write permissions and everytihng...
I need to get this to work so badly please guys help!!!!
Just need to send outlook tasks from asp.net/vb.net to a user.
-
Oct 14th, 2004, 06:29 PM
#2
Hi,
Did you try giving permissions for the Outlook .pst file ?
Cheers,
NTG
-
Oct 14th, 2004, 07:03 PM
#3
Thread Starter
Banned
Originally posted by ntg
Hi,
Did you try giving permissions for the Outlook .pst file ?
Cheers,
NTG
How where ? Which PST ? Mine locally ???
-
Oct 14th, 2004, 11:27 PM
#4
Originally posted by jhermiz
How where ? Which PST ? Mine locally ???
This:
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
-
Oct 15th, 2004, 06:56 AM
#5
Thread Starter
Banned
Originally posted by mendhak
This:
I have read this already, this doesnt help at all.
What file??? Where ???? Locally ???? What does PST have to do with sending tasks????
-
Oct 15th, 2004, 11:57 AM
#6
Addicted Member
OK.
Here's an important question to ask yourself as it realtes to this issue. Is Outlook running stand-alone or is it connected to an Exchange Server?
If it's running stand-alone, then the ASP account will need access to the file. These permissions are set on the actual .pst file (This is the file that contains all the Outlook folder when you run in this mode. If that account doesn't have write permissions to this file then it can't do anything with it. Since a task is an object in that file, if you can't write to the file, you can't create the task. The permissions are set from inside the OS. If you don't know how to do this, find someone who does.
If Outlook is connected to an Exchange Server, then the ASP account will need access to the mailbox on the server that you want to create tasks in. This can only be done by a sysadmin, AND the ASP account will need to be a domain account to be given the appropriate permissions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|