Outlook Developer Home
Outlook Programmer's Library
Outlook Technologies
Outlook Forms
Other Technologies



To convert imported data to custom fields

Outlook allows you to import data directly only to built-in forms, not custom forms. Importing directly to custom forms takes code or a third-party tool. An alternative is to import to a built-in form, using the fields provided for that form, then convert the items to use your custom form and custom fields. This Outlook VBA code sample, for Contact items, does both. It converts data imported to the built-in User1, User2, User3, and User4 properties to four user-defined properties present in a custom form. Run it after you have imported the data.

Code Sample


This code was written in Outlook VBA, but can be adapted to work with Outlook 97 and Outlook 98 by using automation from Word or Excel VBA. Note that it demonstrates the syntax for built-in and custom properties:
  • objItem.User1
  • objItem.UserProperties("Custom1")

You can adapt this method to other types of forms. The Mileage and BillingInformation fields appear in all Outlook items, are rarely used to hold actual data, and, therefore, might be good for "parking" imported data until you can convert it to custom fields.

If you want to apply this technique to changing the FileAs property for imported data, you need to be aware that FileAs is a little quirky. What you see in the contact item as Full Name (Company) is actually stored as "Full Name" & vbCrLf & "Company" -- with no parentheses in sight. See Set file as property on designed form for a discussion and example of this issue.

See To apply a new form to a folder for other methods for applying a custom form to existing data. 

More Information

2002-7 TurtleFlock, LLC
All right reserved.
About OutlookCode.com

Send comments to webmaster@outlookcode.com

Designed and Implemented by TerraLink USA 

FrontPage Integration
by RobsonDesignWorks

get Sue's code | forums | share your own code | registration