Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 24th, 2004, 09:10 AM
Authorized User
 
Join Date: Sep 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access is denied.

Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where
it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access is denied.

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.

Source Error:


Line 11: Public Function startOutlook(ByVal toVal As String, ByVal subjectVal As String, ByVal bodyVal As String)
Line 12: 'Return a reference to the MAPI layer
Line 13: Dim ol As New Outlook.Application
Line 14: Dim ns As Outlook.NameSpace
Line 15: Dim fdMail As Outlook.MAPIFolder

Pls help me!!!!!!!!!!!!!!!!!11
__________________
RK
 
Old November 24th, 2004, 09:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

So... what are you trying to access?

 
Old November 25th, 2004, 12:56 AM
Authorized User
 
Join Date: Sep 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by stu9820
 So... what are you trying to access?



I have a problem while executing the following lines of code. Actually in this code I am opening the MS Outlook and selecting each and every items of the inbox items and saving them in the local folder. This particular code I am executing in the asp.net webform vb as code behind.
 The problem is at the line "objApp = New Outlook.Application" it is throwing an exception saying that "Access is denied." What could be the problem? I have added the Ms Outlook com reference also but still it is giving this error.


Code:

Dim objApp As Outlook.Application
                Dim objNameSpace As Outlook.NameSpace
                Dim objMAPIFolder As Outlook.MAPIFolder
                Dim objMailItem As Outlook.MailItem
                Dim iRow As Integer, i As Integer, j As Integer

                objApp = New Outlook.Application
                objNameSpace = objApp.GetNamespace(Type:="MAPI")
                objMAPIFolder = objNameSpace.GetDefaultFolder(FolderType:=Outlook. OlDefaultFolders.olFolderInbox)
                For i = 1 To objMAPIFolder.Items.Count
                    objMailItem.SaveAs("c:\temp\mmcs\" & objMailItem.Subject & ".msg")
                    If objMailItem.Attachments.Count <> 0 Then
                        For j = 1 To objMailItem.Attachments.Count
                            objMailItem.Attachments.Item(j).SaveAsFile("c:\tem p\mmcs\" & objMailItem.Attachments.Item(j).FileName)
                        Next j
                    End If
                Next i

Thank you sir
I am promptly waiting for your replay
 
Old November 30th, 2004, 12:56 AM
Authorized User
 
Join Date: Sep 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Plzzzzzzzzzzzz

Help me
RK

RK
 
Old November 30th, 2004, 09:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Have you done "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." to this folder "c:\temp\mmcs"?






Similar Threads
Thread Thread Starter Forum Replies Last Post
401.3 Access denied due to Access Control List cforsyth .NET Framework 2.0 8 May 28th, 2009 01:56 PM
access is denied shanwaj ASP.NET 1.0 and 1.1 Basics 0 December 28th, 2007 03:04 AM
Access Denied tys MySQL 4 April 6th, 2007 08:31 AM
Access is Denied khautinh General .NET 1 March 26th, 2004 04:44 PM
Access Denied tys MySQL 0 March 25th, 2004 03:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.