Run-Time error '424': object Required 
Author Message
 Run-Time error '424': object Required

I am trying to validate an appointment before I set it I want to see if I
have any appoints during the time I want to request, but I get the
Run-Time error '424': object Required error.

what is wrong? How can I do this?

Thanks!

Penelope

_______________________________ Code Snippet___________________________

Sub TestAppt(ApptName)

    Dim appt_items As Items
    Dim c As Integer
    Dim strdate As String

    Set obj_Out = New Outlook.Application
    Set ns_Out = obj_Out.GetNamespace("MAPI")

    strdate$ = "#" & Now() & "#"
    Set appt_items = oCalendar.Items.Find("[Start]>= """ & strdate & """")
'<< This is the line that generates the error.....

' will this actually test for a conflict if apptname is assigned

' strdate?
    c = appt_items.Count

    MsgBox c

End Sub



Mon, 10 Oct 2005 00:50:34 GMT  
 Run-Time error '424': object Required
Find (just like FindNext) will return an appointment item. If you need a
restrcted collection (Items object) use Restrict instead.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> I am trying to validate an appointment before I set it I want to see if I
> have any appoints during the time I want to request, but I get the
> Run-Time error '424': object Required error.

> what is wrong? How can I do this?

> Thanks!

> Penelope

> _______________________________ Code Snippet___________________________

> Sub TestAppt(ApptName)

>     Dim appt_items As Items
>     Dim c As Integer
>     Dim strdate As String

>     Set obj_Out = New Outlook.Application
>     Set ns_Out = obj_Out.GetNamespace("MAPI")

>     strdate$ = "#" & Now() & "#"
>     Set appt_items = oCalendar.Items.Find("[Start]>= """ & strdate & """")
> '<< This is the line that generates the error.....

> ' will this actually test for a conflict if apptname is assigned

> ' strdate?
>     c = appt_items.Count

>     MsgBox c

> End Sub



Mon, 10 Oct 2005 01:32:32 GMT  
 Run-Time error '424': object Required
Where can I find info about find and restricted?  Proper syntax etc? I have
looked and looked and can not find anything....
Does that (I am not sure....) address the error?
What I need to do is just to find out if I have any thing scheduled duing a
given period   say "4/21/03 5:30 PM" with a duration of 30 mins....

Thanks!
Penelope


Quote:
> Find (just like FindNext) will return an appointment item. If you need a
> restrcted collection (Items object) use Restrict instead.

> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool



> > I am trying to validate an appointment before I set it I want to see if
I
> > have any appoints during the time I want to request, but I get the
> > Run-Time error '424': object Required error.

> > what is wrong? How can I do this?

> > Thanks!

> > Penelope

> > _______________________________ Code Snippet___________________________

> > Sub TestAppt(ApptName)

> >     Dim appt_items As Items
> >     Dim c As Integer
> >     Dim strdate As String

> >     Set obj_Out = New Outlook.Application
> >     Set ns_Out = obj_Out.GetNamespace("MAPI")

> >     strdate$ = "#" & Now() & "#"
> >     Set appt_items = oCalendar.Items.Find("[Start]>= """ & strdate &
"""")
> > '<< This is the line that generates the error.....

> > ' will this actually test for a conflict if apptname is assigned

> > ' strdate?
> >     c = appt_items.Count

> >     MsgBox c

> > End Sub



Mon, 10 Oct 2005 02:15:02 GMT  
 Run-Time error '424': object Required
I've posted a detailed discourse on using Find and Restrict with date fields at http://www.slipstick.com/dev/finddate.htm
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming: Jumpstart
     for Administrators, Power Users, and Developers
     http://www.slipstick.com/books/jumpstart.htm
Quote:

> Where can I find info about find and restricted?  Proper syntax etc? I have
> looked and looked and can not find anything....
> Does that (I am not sure....) address the error?
> What I need to do is just to find out if I have any thing scheduled duing a
> given period   say "4/21/03 5:30 PM" with a duration of 30 mins....

> Thanks!
> Penelope



> > Find (just like FindNext) will return an appointment item. If you need a
> > restrcted collection (Items object) use Restrict instead.

> > Dmitry Streblechenko (MVP)
> > http://www.dimastr.com/
> > OutlookSpy  - Outlook, CDO
> > and MAPI Developer Tool



> > > I am trying to validate an appointment before I set it I want to see if
> I
> > > have any appoints during the time I want to request, but I get the
> > > Run-Time error '424': object Required error.

> > > what is wrong? How can I do this?

> > > Thanks!

> > > Penelope

> > > _______________________________ Code Snippet___________________________

> > > Sub TestAppt(ApptName)

> > >     Dim appt_items As Items
> > >     Dim c As Integer
> > >     Dim strdate As String

> > >     Set obj_Out = New Outlook.Application
> > >     Set ns_Out = obj_Out.GetNamespace("MAPI")

> > >     strdate$ = "#" & Now() & "#"
> > >     Set appt_items = oCalendar.Items.Find("[Start]>= """ & strdate &
> """")
> > > '<< This is the line that generates the error.....

> > > ' will this actually test for a conflict if apptname is assigned

> > > ' strdate?
> > >     c = appt_items.Count

> > >     MsgBox c

> > > End Sub



Mon, 10 Oct 2005 02:29:14 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Run-time error '424': Object required

2. Run-Time error '424': Object Required

3. Run-time error '424' Object Require

4. Run-time error '424' Object Required

5. Run-time error '424' Object required

6. Run-time error '424' Object required

7. Run-time error '424': Object reduired

8. Run-time error '424': Object reduired

9. Run-time error '424'

10. VB Run time error '424'

11. Run-time error '424'

12. Run-Time error '424'

 

 
Powered by phpBB® Forum Software