Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Mon, 26 May 2008 18:27:05 +0200,    group: microsoft.public.exchange.applications        back       


Error on deleting an appointment   
I'm making a test application with VB6 SP5 and CDO 1.21 which create
appointments and then it tries to delete them. The application has an error
when it tries to access to user messages.  Id' be very grateful if anyone
could help me. The code is the following:

strProfileInfo = g_cServidorExchange & vbLf & cMailbox

    Set ObjSession = New Session
    On Local Error Resume Next
    ObjSession.Logon "", "", False, True, 0, True, strProfileInfo
    If Err.Number <> 0 Then
        cError = Err.Number & " " & Err.Description
        Call AñadirDatosFicheroLog("Error on logon - Error: " & cError,
NIVEL_BAJO)
        Err.Clear
        Exit Function
    End If

    Set ObjCalendarFolder =
ObjSession.GetDefaultFolder(CdoDefaultFolderCalendar)

    Set ObjAppointments = ObjCalendarFolder.Messages <- I get an error in
this line

    For Each ObjOneAppointment In ObjAppointments
        If ObjOneAppointment.Subject = "New SLExchange appointment" &
cMailbox Then
            lPosicion = g_objArrayCita.Find(0, 0, ObjOneAppointment.ID)
            If lPosicion >= 0 Then
                g_objArrayCita.Delete 0, lPosicion
                g_lCitas = g_lCitas - 1
            End If
            Call AñadirDatosFicheroLog("Deleting the appointment with
period: " & ObjOneAppointment.StartTime & " to " &
ObjOneAppointment.EndTime, NIVEL_NORMAL)
            ObjOneAppointment.Delete
            Exit For
        End If
    Next

    Set ObjOneAppointment = Nothing
    Set ObjAppointments = Nothing
    Set ObjCalendarFolder = Nothing

    ObjSession.Logoff

    Set ObjSession = Nothing
date: Mon, 26 May 2008 18:27:05 +0200   author:   Jose Enrique

Re: Error on deleting an appointment   
What is ObjAppointments declared as?

If you step the code do you get a good logon and is ObjCalendarFolder a 
valid CDO Folder object?

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jose Enrique"  wrote in message 
news:eg61X10vIHA.5096@TK2MSFTNGP02.phx.gbl...
> I'm making a test application with VB6 SP5 and CDO 1.21 which create
> appointments and then it tries to delete them. The application has an 
> error
> when it tries to access to user messages.  Id' be very grateful if anyone
> could help me. The code is the following:
>
> strProfileInfo = g_cServidorExchange & vbLf & cMailbox
>
>    Set ObjSession = New Session
>    On Local Error Resume Next
>    ObjSession.Logon "", "", False, True, 0, True, strProfileInfo
>    If Err.Number <> 0 Then
>        cError = Err.Number & " " & Err.Description
>        Call AñadirDatosFicheroLog("Error on logon - Error: " & cError,
> NIVEL_BAJO)
>        Err.Clear
>        Exit Function
>    End If
>
>    Set ObjCalendarFolder =
> ObjSession.GetDefaultFolder(CdoDefaultFolderCalendar)
>
>    Set ObjAppointments = ObjCalendarFolder.Messages <- I get an error in
> this line
>
>    For Each ObjOneAppointment In ObjAppointments
>        If ObjOneAppointment.Subject = "New SLExchange appointment" &
> cMailbox Then
>            lPosicion = g_objArrayCita.Find(0, 0, ObjOneAppointment.ID)
>            If lPosicion >= 0 Then
>                g_objArrayCita.Delete 0, lPosicion
>                g_lCitas = g_lCitas - 1
>            End If
>            Call AñadirDatosFicheroLog("Deleting the appointment with
> period: " & ObjOneAppointment.StartTime & " to " &
> ObjOneAppointment.EndTime, NIVEL_NORMAL)
>            ObjOneAppointment.Delete
>            Exit For
>        End If
>    Next
>
>    Set ObjOneAppointment = Nothing
>    Set ObjAppointments = Nothing
>    Set ObjCalendarFolder = Nothing
>
>    ObjSession.Logoff
>
>    Set ObjSession = Nothing
>
>
date: Tue, 27 May 2008 09:20:44 -0400   author:   Ken Slovak - [MVP - Outlook]

Re: Error on deleting an appointment   
Thanks for answering. This is the declarations part of my code:

    Dim ObjCalendarFolder As Folder
    Dim ObjAppointments As Messages
    Dim ObjAppointmentFilter As MessageFilter
    Dim ObjOneAppointment As AppointmentItem
    Dim strProfileInfo As String
    Dim ObjSession As Session

"Ken Slovak - [MVP - Outlook]"  escribió en el mensaje
news:OSeS1AAwIHA.3680@TK2MSFTNGP05.phx.gbl...
> What is ObjAppointments declared as?
>
> If you step the code do you get a good logon and is ObjCalendarFolder a
> valid CDO Folder object?
>
> -- 
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Jose Enrique"  wrote in message
> news:eg61X10vIHA.5096@TK2MSFTNGP02.phx.gbl...
> > I'm making a test application with VB6 SP5 and CDO 1.21 which create
> > appointments and then it tries to delete them. The application has an
> > error
> > when it tries to access to user messages.  Id' be very grateful if
anyone
> > could help me. The code is the following:
> >
> > strProfileInfo = g_cServidorExchange & vbLf & cMailbox
> >
> >    Set ObjSession = New Session
> >    On Local Error Resume Next
> >    ObjSession.Logon "", "", False, True, 0, True, strProfileInfo
> >    If Err.Number <> 0 Then
> >        cError = Err.Number & " " & Err.Description
> >        Call AñadirDatosFicheroLog("Error on logon - Error: " & cError,
> > NIVEL_BAJO)
> >        Err.Clear
> >        Exit Function
> >    End If
> >
> >    Set ObjCalendarFolder =
> > ObjSession.GetDefaultFolder(CdoDefaultFolderCalendar)
> >
> >    Set ObjAppointments = ObjCalendarFolder.Messages <- I get an error in
> > this line
> >
> >    For Each ObjOneAppointment In ObjAppointments
> >        If ObjOneAppointment.Subject = "New SLExchange appointment" &
> > cMailbox Then
> >            lPosicion = g_objArrayCita.Find(0, 0, ObjOneAppointment.ID)
> >            If lPosicion >= 0 Then
> >                g_objArrayCita.Delete 0, lPosicion
> >                g_lCitas = g_lCitas - 1
> >            End If
> >            Call AñadirDatosFicheroLog("Deleting the appointment with
> > period: " & ObjOneAppointment.StartTime & " to " &
> > ObjOneAppointment.EndTime, NIVEL_NORMAL)
> >            ObjOneAppointment.Delete
> >            Exit For
> >        End If
> >    Next
> >
> >    Set ObjOneAppointment = Nothing
> >    Set ObjAppointments = Nothing
> >    Set ObjCalendarFolder = Nothing
> >
> >    ObjSession.Logoff
> >
> >    Set ObjSession = Nothing
> >
> >
>
date: Tue, 27 May 2008 17:47:13 +0200   author:   Jose Enrique

Re: Error on deleting an appointment   
Did you try what I suggested and step the code?

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jose Enrique"  wrote in message 
news:uzVkwDBwIHA.5448@TK2MSFTNGP04.phx.gbl...
> Thanks for answering. This is the declarations part of my code:
>
>    Dim ObjCalendarFolder As Folder
>    Dim ObjAppointments As Messages
>    Dim ObjAppointmentFilter As MessageFilter
>    Dim ObjOneAppointment As AppointmentItem
>    Dim strProfileInfo As String
>    Dim ObjSession As Session
date: Tue, 27 May 2008 14:06:42 -0400   author:   Ken Slovak - [MVP - Outlook]

Re: Error on deleting an appointment   
How can I do that?

"Ken Slovak - [MVP - Outlook]"  escribió en el mensaje
news:uNFYXSCwIHA.5288@TK2MSFTNGP06.phx.gbl...
> Did you try what I suggested and step the code?
>
> -- 
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Jose Enrique"  wrote in message
> news:uzVkwDBwIHA.5448@TK2MSFTNGP04.phx.gbl...
> > Thanks for answering. This is the declarations part of my code:
> >
> >    Dim ObjCalendarFolder As Folder
> >    Dim ObjAppointments As Messages
> >    Dim ObjAppointmentFilter As MessageFilter
> >    Dim ObjOneAppointment As AppointmentItem
> >    Dim strProfileInfo As String
> >    Dim ObjSession As Session
>
date: Wed, 28 May 2008 11:28:46 +0200   author:   Jose Enrique

Re: Error on deleting an appointment   
You set a breakpoint in your code at the point where you start that 
procedure and start the code in the debugger. When you hit the breakpoint 
you can then step the code using F8. At each step you can check for errors 
and to evaluate the values of variables and see if objects are null 
(Nothing).

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jose Enrique"  wrote in message 
news:ONsA9UKwIHA.5472@TK2MSFTNGP06.phx.gbl...
> How can I do that?
date: Wed, 28 May 2008 09:03:36 -0400   author:   Ken Slovak - [MVP - Outlook]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us