![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |