![]() |
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
|
|||
|
|||
![]()
I am trying to get a list of contacts (using the Restict() method) in a
Outlook 2003 Contact folder that do NOT have an Email1Address assigned. These (Jet?) queries do NOT eliminate contacts without an Email1Address: [Email1Address] '' NOT([Email1Address] = '') NOT([Email1Address] IS NULL) 'plus lower-case variations "[Email1Address]" & Chr(34) & Chr(34) Email1Address that are missing are considered Nothing in the Immediate window, btw. I'm using .Net framework 2.0. I am testing in Offline mode, if that makes a difference. Can someone shed some light on this for me? Thanks, Craig Buchanan |
Ads |
#2
|
|||
|
|||
![]()
You can use a DASL query for that using the undocumented "@SQL=" prefix.
Using that syntax your query for only items with an Email1Address would look like this in VB.NET: Dim sFilter As String = "@SQL=NOT(urn:schemas:contacts:email1 IS NULL)" -- 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 "Craig Buchanan" wrote in message ... I am trying to get a list of contacts (using the Restict() method) in a Outlook 2003 Contact folder that do NOT have an Email1Address assigned. These (Jet?) queries do NOT eliminate contacts without an Email1Address: [Email1Address] '' NOT([Email1Address] = '') NOT([Email1Address] IS NULL) 'plus lower-case variations "[Email1Address]" & Chr(34) & Chr(34) Email1Address that are missing are considered Nothing in the Immediate window, btw. I'm using .Net framework 2.0. I am testing in Offline mode, if that makes a difference. Can someone shed some light on this for me? Thanks, Craig Buchanan |
#3
|
|||
|
|||
![]()
Ken-
Thanks for the reply. Why don't Jet queries support IS NULL or ''? Thanks, Craig "Ken Slovak - [MVP - Outlook]" wrote: You can use a DASL query for that using the undocumented "@SQL=" prefix. Using that syntax your query for only items with an Email1Address would look like this in VB.NET: Dim sFilter As String = "@SQL=NOT(urn:schemas:contacts:email1 IS NULL)" -- 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 "Craig Buchanan" wrote in message ... I am trying to get a list of contacts (using the Restict() method) in a Outlook 2003 Contact folder that do NOT have an Email1Address assigned. These (Jet?) queries do NOT eliminate contacts without an Email1Address: [Email1Address] '' NOT([Email1Address] = '') NOT([Email1Address] IS NULL) 'plus lower-case variations "[Email1Address]" & Chr(34) & Chr(34) Email1Address that are missing are considered Nothing in the Immediate window, btw. I'm using .Net framework 2.0. I am testing in Offline mode, if that makes a difference. Can someone shed some light on this for me? Thanks, Craig Buchanan |
#4
|
|||
|
|||
![]()
Why's the sky blue? g
Jet queries do support that sort of thing and in VBA code I'd use something like this: "[Email1Address] " & Chr(34) & Chr(34) However in .NET code I've found many cases where a property is not there even if in VBA code it would be null string. It might be null string or null (Nothing) in .NET code. So for me it's a lot easier to avoid that possible problem and to just use DASL syntax for the search. Personal preference plus some experience. -- 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 "Craig Buchanan" wrote in message ... Ken- Thanks for the reply. Why don't Jet queries support IS NULL or ''? Thanks, Craig |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
NULL event item ? | Mark Beiley | Add-ins for Outlook | 0 | September 19th 07 12:46 AM |
Restrict Method - Find only blank fields - VBA | Irene | Outlook and VBA | 1 | June 5th 07 05:25 PM |
Using Restrict method to select emails | Jerry West | Outlook and VBA | 16 | April 26th 07 06:48 PM |
Restrict method problem | Mike Epp | Outlook and VBA | 2 | April 7th 06 08:03 PM |
Restrict Method DNW | emanson | Outlook and VBA | 14 | March 28th 06 06:47 AM |