views:

786

answers:

2

Hello . I'm using VB .NET 2005 and Exchange Server 2003 installed I have found some code which gives me the ability to connect in an Exchange Server and create an appointment. The thing is that I cannot find the CDO. Appointment. Where can I find it and make the below code to work ? I have tried all the examples with CDO and Outlook. I believe that the below code need to be produced in an Exchange environment and use CDOEX.DLL ? Appreciate any help or ideas you can give me. Thank you

[Sample Code]

sURL = "http://ExchangeServername/Exchange/testuser/calendar"

        Dim oCn As ADODB.Connection = New ADODB.Connection()

        'oCn.Provider = "exoledb.datasource";
   'I am using the below provider because I am in the client side 
    oCn.Provider = "MSDAIPP.DSO"

        oCn.Open(sURL, "testuser", "q1w2e3r4t5", 0)
        If oCn.State = 1 Then
            MsgBox("Good Connection")
        Else
            MsgBox("Bad Connection")
            Return
        End If

        Dim iConfg As CDO.Configuration = New CDO.Configuration()
        Dim oFields As ADODB.Fields

        oFields = iConfg.Fields
        oFields.Item(CDO.CdoCalendar.cdoTimeZoneIDURN).Value = CDO.CdoTimeZoneId.cdoAthens
        'oFields.Item(CDO.CdoConfiguration.cdoSendEmailAddress).Value = "[email protected]"
        oFields.Update()



        Dim oApp As CDO.Appointment = New CDO.Appointment()
         oApp.Configuration = iConfg
        oApp.StartTime = Convert.ToDateTime("10/11/2001 10:00:00 AM")
        oApp.EndTime = Convert.ToDateTime("10/11/2001 11:00:00 AM")
        oApp.Location = "My Location"
        oApp.Subject = "Test: Create Meeting in VB.NET"
        oApp.TextBody = "Hello..."

        '' Add recurring appointment
        '' Every Thursday starting today, and repeat 3 times.

        '' Save to the folder
        oApp.DataSource.SaveToContainer(sURL, , _
         ADODB.ConnectModeEnum.adModeReadWrite, _
         ADODB.RecordCreateOptionsEnum.adCreateNonCollection, _
         ADODB.RecordOpenOptionsEnum.adOpenSource, _
         "", "")

        oCn.Close()

        oApp = Nothing
        oCn = Nothing
        oFields = Nothing
+1  A: 

CDO.Appointment indeed is part of cdoex.dll (Collaboration Data Objects for Exchange) that comes with some versions of Exchange, SPS and Office. You can download and register cdoex.dll on your machine, and reference it in your VB.Net application.

These posts should be helpful:

Patrick de Kleijn
A: 

If you cannot find a copy of cdoex.dll on your local PC or server, try these downloads:

http://www.google.nl/search?q=download+CDOEX.DLL

Patrick de Kleijn