![]() |
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 have written a macro that lists all duplicates in an outlook contacts folder. Now that I know which contacts are duplicated, I am trying to find out WHAT differences, if any, there are between the duplicates. So, does anyone know how to find/list all the non empty fields in any given contact using vba? Thanks. |
#2
|
|||
|
|||
![]()
You can use the ItemProperties collection to iterate all the standard fields except for collection like Links.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Chris S" wrote in message ... Hi, I have written a macro that lists all duplicates in an outlook contacts folder. Now that I know which contacts are duplicated, I am trying to find out WHAT differences, if any, there are between the duplicates. So, does anyone know how to find/list all the non empty fields in any given contact using vba? Thanks. |
#3
|
|||
|
|||
![]()
On Dec 18, 3:52 pm, "Sue Mosher [MVP-Outlook]"
wrote: You can use the ItemProperties collection to iterate all the standard fields except for collection like Links. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Chris S" wrote in ... Hi, I have written a macro that lists all duplicates in an outlook contacts folder. Now that I know which contacts are duplicated, I am trying to find out WHAT differences, if any, there are between the duplicates. So, does anyone know how to find/list all the non empty fields in any given contact using vba? Thanks. Thanks Sue. I am currently trying that route, but so far not successfully! this is what I have: For Each ItemProperty In olColItems(i).ItemProperties If ItemProperty Is Empty Then propCount = propCount + 1 Next But I get an object required error on the If statement... I am not sure i am using it properly, do you have any ideas what I am doing wrong? i am trying to get proCount to be populated with the number of fields that are NOT empty in any given contact. |
#4
|
|||
|
|||
![]()
How is olColItems instantiated?
I'm not sure that Empty is going to work, as standard properties generally do have values. Try looking at ItemProperty.Type and then test for "", 0, and #1/1/4501#, depending on whether the property is text, numeric, or date/time. You should ignore any properties where Type = olOutlookInternal, olFormula, or olCombination. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Chris S" wrote in message ... I have written a macro that lists all duplicates in an outlook contacts folder. Now that I know which contacts are duplicated, I am trying to find out WHAT differences, if any, there are between the duplicates. this is what I have: For Each ItemProperty In olColItems(i).ItemProperties If ItemProperty Is Empty Then propCount = propCount + 1 Next But I get an object required error on the If statement... I am not sure i am using it properly, do you have any ideas what I am doing wrong? i am trying to get proCount to be populated with the number of fields that are NOT empty in any given contact. |
#5
|
|||
|
|||
![]()
On Dec 18, 5:01 pm, "Sue Mosher [MVP-Outlook]"
wrote: How is olColItems instantiated? I'm not sure that Empty is going to work, as standard properties generally do have values. Try looking at ItemProperty.Type and then test for "", 0, and #1/1/4501#, depending on whether the property is text, numeric, or date/time. You should ignore any properties where Type = olOutlookInternal, olFormula, or olCombination. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Chris S" wrote in ... I have written a macro that lists all duplicates in an outlook contacts folder. Now that I know which contacts are duplicated, I am trying to find out WHAT differences, if any, there are between the duplicates. this is what I have: For Each ItemProperty In olColItems(i).ItemProperties If ItemProperty Is Empty Then propCount = propCount + 1 Next But I get an object required error on the If statement... I am not sure i am using it properly, do you have any ideas what I am doing wrong? i am trying to get proCount to be populated with the number of fields that are NOT empty in any given contact. olcolitems is DIM'ed as outlook.items a an SET to contain individual contact items from the default contact folder (i am also DIM'ming/ SET'ing an outlook.application, an outlook.namespace and an outlook.mapifolder), and seems to work well in the context of my duplicate finding macro. i dont, however, understand what you mean by testing for property type, as i am looking to count/list non empty fields. |
#6
|
|||
|
|||
![]()
The problem is that "non empty" is meaningless in your scenario, because standard properties generally are not null or empty. They have values. If you want to know whether a property is "blank," you need to test for the value appropriate to that type of property. For example, you might consider a "blank" text property to be one with a value of "". A "blank" date/time property would have a value of #1/1/4501#.
Please show the code you're using to instantiate olColItems. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Chris S" wrote in message ... On Dec 18, 5:01 pm, "Sue Mosher [MVP-Outlook]" wrote: How is olColItems instantiated? I'm not sure that Empty is going to work, as standard properties generally do have values. Try looking at ItemProperty.Type and then test for "", 0, and #1/1/4501#, depending on whether the property is text, numeric, or date/time. You should ignore any properties where Type = olOutlookInternal, olFormula, or olCombination. "Chris S" wrote in ... I have written a macro that lists all duplicates in an outlook contacts folder. Now that I know which contacts are duplicated, I am trying to find out WHAT differences, if any, there are between the duplicates. this is what I have: For Each ItemProperty In olColItems(i).ItemProperties If ItemProperty Is Empty Then propCount = propCount + 1 Next But I get an object required error on the If statement... I am not sure i am using it properly, do you have any ideas what I am doing wrong? i am trying to get proCount to be populated with the number of fields that are NOT empty in any given contact. olcolitems is DIM'ed as outlook.items a an SET to contain individual contact items from the default contact folder (i am also DIM'ming/ SET'ing an outlook.application, an outlook.namespace and an outlook.mapifolder), and seems to work well in the context of my duplicate finding macro. i dont, however, understand what you mean by testing for property type, as i am looking to count/list non empty fields. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Read email and compare text | Satish | Outlook - General Queries | 0 | December 28th 06 03:26 PM |
How can I compare two contact files to highlight differences? | Mark | Outlook - Using Contacts | 1 | October 4th 06 09:39 PM |
how can I compare two contact lists in order to avoid repetition | Pabs | Outlook - Using Contacts | 2 | September 27th 06 05:18 PM |
How do I compare two contact files | Jaron | Outlook - Using Contacts | 1 | August 30th 06 02:50 PM |
compare multiple contact lists | Tish | Outlook - Using Contacts | 1 | April 29th 06 04:07 PM |