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