Help on CDOEX library
Hi All,
I am novice person for exchange 2000 programming. Please help me to
solve this problem.
I have created one vb6 application for creating the contact on one of
the user on exchange server ( I got the similar code on MS site in
c#). I have 3 users
on exchange viz. smoadmin, administrator & trial. My code snippet is
as follows -
Private Sub Command1_Click()
On Error GoTo ErrHandle
Dim oItem As CDO.Item
Set oItem = New CDO.Item
Dim sURL As String
sURL = "http://sbsserver/Exchange/smoadmin/contacts"
Dim oFields As ADODB.Fields
Set oFields = oItem.Fields
oFields("DAV:contentclass").Value = "urn:content-classes:person"
oFields("http://schemas.microsoft.com/exchange/
outlookmessageclass").Value = "IPM.Contact"
oFields("urn:schemas:contacts:cn").Value = "David Jones"
oFields("urn:schemas:contacts:nickname").Value = "Dave"
oFields("urn:schemas:contacts:title").Value = "Engineer"
oFields("urn:schemas:contacts:department").Value = "DSX Messaging"
oFields("urn:schemas:contacts:email1").Value = "someone@example.com"
oFields.Update
oItem.DataSource.SaveToContainer sURL, Nothing, _
ADODB.ConnectModeEnum.adModeReadWrite, _
ADODB.RecordCreateOptionsEnum.adCreateNonCollection, _
ADODB.RecordOpenOptionsEnum.adOpenSource, _
"", ""
Set oItem = Nothing
Set oFields = Nothing
MsgBox "done"
Exit Sub
ErrHandle:
MsgBox Err.Number & " -> " & Err.Description
End Sub
Now I execute this application on exchange server, it works fine. If I
change sURL to "http://sbsserver/Exchange/administrator/contacts",
then also it works
fine! But when I change sURL to "http://sbsserver/Exchange/trial/
contacts", then it throws the error "Unspecified error" at
SaveToContainer statement. What
should I do for it. Please can anybody tell me where to find CDOEX
help from start to finish.
Also I noticed one thing, that I can write down "http://sbsserver/
Exchange/smoadmin/contacts" in internet explorer directly to get the
contacts of
smoadmin person. But if I want to get the contacts folder of trial
then I have to user "http://sbsserver/Exchange/trial2/contacts" i.e.
trial2 instead of
trial. Furher some other questions are -
1> How to create a task for user in exchange programmatically?
2> Where to find the correct url for folder in exchange (like "http://
sbsserver/Exchange/smoadmin/contacts" --- I have just tried it
manually)?
3> Where to find all references for urn:schemas values?
Please help me!
Thanks in advance,
Dhananjay
date: Tue, 22 Jan 2008 05:45:54 -0800 (PST)
author: Dhananjay