0

我正在使用 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
4

2 回答 2

2

CDO.Appointment 确实是某些版本的 Exchange、SPS 和 Office 附带的 cdoex.dll(Exchange 协作数据对象)的一部分。您可以在您的机器上下载并注册 cdoex.dll,并在您的 VB.Net 应用程序中引用它。

这些帖子应该会有所帮助:

于 2008-11-16T02:18:38.997 回答
0

cdoex.dll如果您在本地 PC 或服务器上找不到副本,请尝试以下下载:

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

于 2008-11-16T02:25:49.340 回答