Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help on CDOEX library

0 views
Skip to first unread message

Dhananjay

unread,
Jan 22, 2008, 8:43:32 AM1/22/08
to
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 = "som...@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

Ed Crowley [MVP]

unread,
Jan 22, 2008, 1:44:43 PM1/22/08
to
You should probably post this in the m.p.exchange.applications newsgroup.
I've done some CDOEX programming, but not enough to answer your questions.
--
Ed Crowley
MVP - Exchange
"Protecting the world from PSTs and brick backups!"

"Dhananjay" <pandit.d...@gmail.com> wrote in message
news:90f2c05f-ece7-4259...@f10g2000hsf.googlegroups.com...

0 new messages