Where "CDO.Appointment"
I am using VB.NET 2005 and Exchange Server 2003 I found some code that gives me the ability to connect to Exchange Server and create an appointment. The thing is, I can't find CDO. Business date, meeting. Where can I find it and make the code below? I've tried all examples with CDO and Outlook. I believe the below code needs to be generated in an Exchange environment and use CDOEX.DLL? Appreciate any help or ideas you can give me. Thanks you
[Code example]
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 = "test@test.com"
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
0
2 answers