Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO problems

Status
Not open for further replies.

Rilez

Programmer
Jun 15, 2001
94
GB
I am having real problems with CDO/MAPI work within ASP.NET. I am trying to log onto the impersonated users mailbox and add appointments etc there. I literally can't do it no matter what I do. I don't get an error untill I try to access the inbox or an item of the field collection. Everything seems to be pointing me towards a problem with authentication but I can't see the problem for the life of me. Has anyone got any code they know works that I can have a look at - I must be doing SOMETHING but can't see what.

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
If Not IsPostBack Then
WindowsIdentity.Impersonate(CType(User.Identity, WindowsIdentity).Token)

Dim objSession As MAPI.Session
'Dim objFolder As MAPI.Folder
Dim objStore As MAPI.InfoStore
objSession = New MAPI.Session
objSession.Logon(ProfileInfo:="Ronaldinho" & vbLf & "priley", newsession:=True, showdialog:=False)
'objSession.Logon()
'objstore = Server.CreateObject("MAPI.InfoStore")
'explore(objSession.infostores)
Response.Write(Request.ServerVariables("LOGON_USER") & objSession.CurrentUser.name)
Response.Flush()
Response.Write(&quot;<br/>&quot; & objSession.Application & &quot;<br/>&quot;)
For Each objStore In objSession.InfoStores
Response.Write(objStore.Name)
Dim bstrPublicRootID = objStore.Fields.Item(&H66310102).Value '<---- this is currently where I am getting a [Collaboration Data Objects - [MAPI_E_FAILONEPROVIDER(8004011D)]] error
Dim objTopFolder = objSession.GetFolder(bstrPublicRootID, _
objStore.ID)
Dim objFolders = objTopFolder.Folders
Dim objFolder = objFolders.GetFirst()
Response.Write(objfolder.name)
Next
objSession.Logoff()
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top