开发者

Cannot complete the function with CDOEX and Exchange 2000

开发者 https://www.devze.com 2023-02-06 04:03 出处:网络
I am trying to create an appointment using CDOEX in Exchange 2000. The code snippet is from msdn and is VB6.

I am trying to create an appointment using CDOEX in Exchange 2000. The code snippet is from msdn and is VB6.

When I reach this line: ".DataSource.SaveToContainer iMbx.Calendar, Conn" I am getting error "cannot complete the function (800703eb)"

Any help will be appreciated!

Function CreateAppointment(StartTime As Date, _
                            EndTime As Date, _
                            Subject As String, _
                            Location As String, _
                            TextBody As String, _
                            iMbx As IMailbox) As Appointment

' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Exchange 2000 Library

    Dim iAppt       As New Appointment
    Dim Conn        As New ADODB.Conn开发者_Python百科ection
    Conn.Provider = "ExOLEDB.DataSource"

    'Set the appointment properties
    With iAppt
        .StartTime = StartTime
        .EndTime = EndTime
        .Subject = Subject
        .Location = Location
        .TextBody = TextBody
        'Save the appointment
        Conn.Open iMbx.BaseFolder
        .DataSource.SaveToContainer iMbx.Calendar, Conn
    End With

    Set CreateAppointment = iAppt
End Function


I have found the problem and solution, so here it is in case somebody needs it: link Also, I have found examples that saved my life: link

0

精彩评论

暂无评论...
验证码 换一张
取 消