A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

What is wrong in my oOutlookAppointment.Find filter?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 8th 07, 08:48 PM posted to microsoft.public.outlook.program_vba
DENNIS BROWN
external usenet poster
 
Posts: 51
Default What is wrong in my oOutlookAppointment.Find filter?

Hi,
I can't seem to nail down a problem with my filter in the Find method of Items object.
Here is what I'm doing:

My sFilter string is the following:
sFilter="[Start] = '08/07/2007' AND [Start] = '08/08/2007'"
and it returns a single recurring appointment I have on August 7, but not the all day event, and another timed appointment on that same day.
If I do
sFilter="[Start] = '08/06/2007' AND [Start] '08/08/2007'"
Then I get all of August 6 recurring, and *all* of August 7 appointments!
All I want is August 7 appointments--all 3 of them.
What am I doing wrong here?
I have the oFolderItems.IncludeRecurrences = TRUE
and oFolderItems.Sort("[Start]")
And I'm setting columns, but the
oOutlookAppointment=oFolderItems.Find(sFilter)
isn't doing what I want it to do!
Any suggestions?
--

Thanks,
Dennis
  #2  
Old August 8th 07, 08:53 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default What is wrong in my oOutlookAppointment.Find filter?

Try adding hours and minutes components to your filter (not seconds) and see
how that works. Don't forget that all day events begin at 00:00 of that
date.
--
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


"DENNIS BROWN" wrote in message
. ..
Hi,
I can't seem to nail down a problem with my filter in the Find method of
Items object.
Here is what I'm doing:

My sFilter string is the following:
sFilter="[Start] = '08/07/2007' AND [Start] = '08/08/2007'"
and it returns a single recurring appointment I have on August 7, but not
the all day event, and another timed appointment on that same day.
If I do
sFilter="[Start] = '08/06/2007' AND [Start] '08/08/2007'"
Then I get all of August 6 recurring, and *all* of August 7 appointments!
All I want is August 7 appointments--all 3 of them.
What am I doing wrong here?
I have the oFolderItems.IncludeRecurrences = TRUE
and oFolderItems.Sort("[Start]")
And I'm setting columns, but the
oOutlookAppointment=oFolderItems.Find(sFilter)
isn't doing what I want it to do!
Any suggestions?
--

Thanks,
Dennis

  #3  
Old August 9th 07, 01:34 AM posted to microsoft.public.outlook.program_vba
DENNIS BROWN
external usenet poster
 
Posts: 51
Default What is wrong in my oOutlookAppointment.Find filter?

That did it!
Is times like 00:00 and 23:59 ok, or do I need to use 12:00 AM and 11:59 PM instead? The 00:00 and 23:59 seem to work currently.
Will I run into issues using those on international versions of Outlook?
Also, will the routines work in 2002 and 2003? I'm currently using this in 2007.

--

Thanks,
Dennis
"Ken Slovak - [MVP - Outlook]" wrote in message ...
Try adding hours and minutes components to your filter (not seconds) and see how that works. Don't forget that all day events begin at 00:00 of that date.
--
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


"DENNIS BROWN" wrote in message . ..
Hi,
I can't seem to nail down a problem with my filter in the Find method of Items object.
Here is what I'm doing:

My sFilter string is the following:
sFilter="[Start] = '08/07/2007' AND [Start] = '08/08/2007'"
and it returns a single recurring appointment I have on August 7, but not the all day event, and another timed appointment on that same day.
If I do
sFilter="[Start] = '08/06/2007' AND [Start] '08/08/2007'"
Then I get all of August 6 recurring, and *all* of August 7 appointments!
All I want is August 7 appointments--all 3 of them.
What am I doing wrong here?
I have the oFolderItems.IncludeRecurrences = TRUE
and oFolderItems.Sort("[Start]")
And I'm setting columns, but the
oOutlookAppointment=oFolderItems.Find(sFilter)
isn't doing what I want it to do!
Any suggestions?
--

Thanks,
Dennis
  #4  
Old August 9th 07, 03:21 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default What is wrong in my oOutlookAppointment.Find filter?

Don't use AM and PM, use 24-hour time, it works best in almost all language
and internationalization settings.

Outlook (MAPI) stores all date/time values internally as UTC and converts
them when they are used by Outlook to local time. If you aren't directly
accessing MAPI properties (like from PropertyAccessor in Outlook 2007) you
always get local time back. You do get UTC if you work with MAPI props or
PropertyAccessor.

In general it's usually best to test for ranges rather than hard times,
there could be rounding errors or other slight differences where an equality
test would fail where a range test would work.

If you use any of the Outlook 2007 methods that adjust local to UTC or vice
versa you especially have to work with ranges, those functions round a
date/time to the nearest minute, so using those you can't ever expect an
equality test to work.

--
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


"DENNIS BROWN" wrote in message
...
That did it!
Is times like 00:00 and 23:59 ok, or do I need to use 12:00 AM and 11:59
PM instead? The 00:00 and 23:59 seem to work currently.
Will I run into issues using those on international versions of Outlook?
Also, will the routines work in 2002 and 2003? I'm currently using this
in 2007.

--

Thanks,
Dennis

  #5  
Old August 9th 07, 04:58 PM posted to microsoft.public.outlook.program_vba
DENNIS BROWN
external usenet poster
 
Posts: 51
Default What is wrong in my oOutlookAppointment.Find filter?

Thanks!

--

Thanks,
Dennis
"Ken Slovak - [MVP - Outlook]" wrote in message ...
Don't use AM and PM, use 24-hour time, it works best in almost all language and internationalization settings.

Outlook (MAPI) stores all date/time values internally as UTC and converts them when they are used by Outlook to local time. If you aren't directly accessing MAPI properties (like from PropertyAccessor in Outlook 2007) you always get local time back. You do get UTC if you work with MAPI props or PropertyAccessor.

In general it's usually best to test for ranges rather than hard times, there could be rounding errors or other slight differences where an equality test would fail where a range test would work.

If you use any of the Outlook 2007 methods that adjust local to UTC or vice versa you especially have to work with ranges, those functions round a date/time to the nearest minute, so using those you can't ever expect an equality test to work.

--
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


"DENNIS BROWN" wrote in message ...
That did it!
Is times like 00:00 and 23:59 ok, or do I need to use 12:00 AM and 11:59 PM instead? The 00:00 and 23:59 seem to work currently.
Will I run into issues using those on international versions of Outlook?
Also, will the routines work in 2002 and 2003? I'm currently using this in 2007.

--

Thanks,
Dennis
  #6  
Old August 9th 07, 12:19 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default What is wrong in my oOutlookAppointment.Find filter?

Are you calling Start before IncludeRecurrences? The order is critical. See http://www.outlookcode.com/article.aspx?id=30

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"DENNIS BROWN" wrote in message . ..
Hi,
I can't seem to nail down a problem with my filter in the Find method of Items object.
Here is what I'm doing:

My sFilter string is the following:
sFilter="[Start] = '08/07/2007' AND [Start] = '08/08/2007'"
and it returns a single recurring appointment I have on August 7, but not the all day event, and another timed appointment on that same day.
If I do
sFilter="[Start] = '08/06/2007' AND [Start] '08/08/2007'"
Then I get all of August 6 recurring, and *all* of August 7 appointments!
All I want is August 7 appointments--all 3 of them.
What am I doing wrong here?
I have the oFolderItems.IncludeRecurrences = TRUE
and oFolderItems.Sort("[Start]")
And I'm setting columns, but the
oOutlookAppointment=oFolderItems.Find(sFilter)
isn't doing what I want it to do!
Any suggestions?
--

Thanks,
Dennis
  #7  
Old August 9th 07, 01:31 AM posted to microsoft.public.outlook.program_vba
DENNIS BROWN
external usenet poster
 
Posts: 51
Default What is wrong in my oOutlookAppointment.Find filter?

Sure am! I found out the hard way!g

--

Thanks,
Dennis
"Sue Mosher [MVP-Outlook]" wrote in message ...
Are you calling Start before IncludeRecurrences? The order is critical. See http://www.outlookcode.com/article.aspx?id=30

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"DENNIS BROWN" wrote in message . ..
Hi,
I can't seem to nail down a problem with my filter in the Find method of Items object.
Here is what I'm doing:

My sFilter string is the following:
sFilter="[Start] = '08/07/2007' AND [Start] = '08/08/2007'"
and it returns a single recurring appointment I have on August 7, but not the all day event, and another timed appointment on that same day.
If I do
sFilter="[Start] = '08/06/2007' AND [Start] '08/08/2007'"
Then I get all of August 6 recurring, and *all* of August 7 appointments!
All I want is August 7 appointments--all 3 of them.
What am I doing wrong here?
I have the oFolderItems.IncludeRecurrences = TRUE
and oFolderItems.Sort("[Start]")
And I'm setting columns, but the
oOutlookAppointment=oFolderItems.Find(sFilter)
isn't doing what I want it to do!
Any suggestions?
--

Thanks,
Dennis
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2000 on Vista cannot find the WAB.DLL file. What's wrong? Roadrunner_34 Outlook - Installation 1 March 10th 07 02:11 AM
[FIND MESSAGE] fails to find messages for 2007 Arvin Rex Outlook Express 4 February 6th 07 08:11 PM
'Find' does not find contacts in Outlook Loquela Outlook - Using Contacts 0 October 11th 06 11:43 AM
Find and advance find does not find anything ever Terri Schoerner Outlook - Using Contacts 1 February 1st 06 09:40 PM
2003 calendar's find, doesn't find items created today till tomarr Support7556 Outlook - Calandaring 11 January 20th 06 09:54 PM


All times are GMT +1. The time now is 11:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.