我正在使用 VB .NET 2005 和安装的 Exchange Server 2003 我找到了一些代码,这些代码使我能够连接到 Exchange Server 并创建约会。问题是我找不到 CDO。预约。我在哪里可以找到它并使下面的代码工作?我已经使用 CDO 和 Outlook 尝试了所有示例。我相信下面的代码需要在 Exchange 环境中生成并使用 CDOEX.DLL ?感谢您能给我的任何帮助或想法。谢谢
[示例代码]
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