hi all i m automating outlook i have made a Assembly for this that gives us all items in the inbox when i call this Assembly from a visual basic.net Application it runs fine but when i try to call it from an asp.net page it gives an asp error (Access is denied).This error occurs when i m making a Application object in the Assembly.
My Assembly Code is
Function getInbox() As Object
Try
Dim obOutlook As New Outlook.Application()
Dim gnspNameSpace As Outlook.NameSpace
gnspNameSpace = obOutlook.GetNamespace("MAPI")
gnspNameSpace.Logon()
Dim itms As Object
Dim fldContacts As Outlook.MAPIFolder
Dim fldContacts1 As Outlook.MAPIFolder
fldContacts = gnspNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
itms = fldContacts.Items
getInbox = itms
Catch ex As Exception
getInbox = ex
End Try
End Function
Error Occurs at the first line when i Call Dll from Asp Page At Application Object Creation
My asp code is
1 dim getobject as new Automation.Inbox()
2 dim getbox as object
3 getbox=getobject.getInbox()
..............
..................
Error occurs at line 3 when in getinnbox function Apllication Object is created