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 | Display Modes |
#1
|
|||
|
|||
User-Defined Fields in Folder
Looking for suggestions on how to programmatically access (VBA) the
user-defined fields on the -folder- level of an Outlook Contact. I've tried using "UserProperty" but I cannot get it to return any results even though I've checked and double-checked that I'm using it properly. It appears to only return results for user-defined fields on the -item- not the -folder-, which is what I need. Much appreciated! --Patrick |
#2
|
|||
|
|||
User-Defined Fields in Folder
Please explain in more detail just what you're trying to do.
FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/comm....program_v ba -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx wrote in message oups.com... Looking for suggestions on how to programmatically access (VBA) the user-defined fields on the -folder- level of an Outlook Contact. I've tried using "UserProperty" but I cannot get it to return any results even though I've checked and double-checked that I'm using it properly. It appears to only return results for user-defined fields on the -item- not the -folder-, which is what I need. Much appreciated! --Patrick |
#3
|
|||
|
|||
User-Defined Fields in Folder
I'm trying to programmatically export outlook contacts to an MS-Access
database. I've run into two issues: 1. The program halts when a distribution list is encountered. 2. There is a user-defined field in the Outlook Folder that I cannot seem to programmatically identify for export. I've tried using If/Then statements to weed out the distribution lists, but have not met with any success. When running the routine on contact lists without distribution lists, it runs perfectly well. Thank you!! Sue Mosher [MVP-Outlook] wrote: Please explain in more detail just what you're trying to do. FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/comm....program_v ba -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx wrote in message oups.com... Looking for suggestions on how to programmatically access (VBA) the user-defined fields on the -folder- level of an Outlook Contact. I've tried using "UserProperty" but I cannot get it to return any results even though I've checked and double-checked that I'm using it properly. It appears to only return results for user-defined fields on the -item- not the -folder-, which is what I need. Much appreciated! --Patrick |
#4
|
|||
|
|||
User-Defined Fields in Folder
1) Your code should handle this either with an On Error Resume Next statement to ignore the error or by checking the Class property of each item to see if it is a ContactItem before invoking any contact-specific properties.
2) In the context of an export, what fields are defined at the folder level is irrelevant. All the custom fields available for export will be in each item's UserProperties collection, because it is ***in the item*** that the data resides. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx wrote in message oups.com... I'm trying to programmatically export outlook contacts to an MS-Access database. I've run into two issues: 1. The program halts when a distribution list is encountered. 2. There is a user-defined field in the Outlook Folder that I cannot seem to programmatically identify for export. I've tried using If/Then statements to weed out the distribution lists, but have not met with any success. When running the routine on contact lists without distribution lists, it runs perfectly well. Looking for suggestions on how to programmatically access (VBA) the user-defined fields on the -folder- level of an Outlook Contact. I've tried using "UserProperty" but I cannot get it to return any results even though I've checked and double-checked that I'm using it properly. It appears to only return results for user-defined fields on the -item- not the -folder-, which is what I need. |
#5
|
|||
|
|||
User-Defined Fields in Folder
|
#6
|
|||
|
|||
User-Defined Fields in Folder
Distribution List issue - Simple solution to #1 is to filter your
contact items to "exclude" IPM.DistList message class items or alternatively just "include" the specific message class(es) you want to process. Form level user-defined fields versus User-Property collection User-property collection may contain all the user-defined fields BUT it will also contain USELESS field info if there has been any kind of editing done where fields have been added/deleted etc which must be handled if just trying to traverse the user-property collection. Not quite as simple and straight-forward as olContact.UserProperties("FieldName") which will return the correct entry. Unfortunately, that approach only works if you happen to know all the field names up front when writing the code. Otherwise one has to hope that Outlook hasn't introduced one of its many "undocumented features". There are a whole myriad of scenarios/caveats for both the folder level & item level property collections and Outlook can make problematic situations very easy to occur. Can't depend on either collection to be "accurate" for a specific outcome without somehow knowing (guessing or otherwise stating) what is and isn't relevant (not to mention having to dynamically alter the output file to keep adding new fields if the plan is to simply go through each contact one at a time). However, as Brian correctly stated - this is really an issue related to the programming group. Karl __________________________________________________ ___________ ContactGenie - Importer 1.3 / DataPorter 2.0 / Exporter "Power contact importers/exporters for MS Outlook '2000/2003" http://www.contactgenie.com "Sue Mosher [MVP-Outlook]" wrote in message ... 1) Your code should handle this either with an On Error Resume Next statement to ignore the error or by checking the Class property of each item to see if it is a ContactItem before invoking any contact-specific properties. 2) In the context of an export, what fields are defined at the folder level is irrelevant. All the custom fields available for export will be in each item's UserProperties collection, because it is ***in the item*** that the data resides. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx wrote in message oups.com... I'm trying to programmatically export outlook contacts to an MS-Access database. I've run into two issues: 1. The program halts when a distribution list is encountered. 2. There is a user-defined field in the Outlook Folder that I cannot seem to programmatically identify for export. I've tried using If/Then statements to weed out the distribution lists, but have not met with any success. When running the routine on contact lists without distribution lists, it runs perfectly well. Looking for suggestions on how to programmatically access (VBA) the user-defined fields on the -folder- level of an Outlook Contact. I've tried using "UserProperty" but I cannot get it to return any results even though I've checked and double-checked that I'm using it properly. It appears to only return results for user-defined fields on the -item- not the -folder-, which is what I need. |
Thread Tools | |
Display Modes | |
|
|