Outlook doesn't support importing to a custom form. You'd have to write custom code or use a third-party application. See http://www.outlookcode.com/d/customimport.htm.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
>Outlook doesn't support importing to a custom form. You'd have to write
>custom code or use a third-party application. See
>http://www.outlookcode.com/d/customimport.htm.
I think I'm pretty much there, though the user properties behaviour is
proving to be a little tricky... I decided to write the code in Excel VBA,
since the contacts to be imported are in Excel anyway.
Basically, the contact gets created OK, and the user-defined fields get
created in the folder but not in the actual contact item. If I change the
third argument of the UserProperties.Add method to False, the UDFs don't get
created at all... The code I'm using is below:
Sub ExportToOutlook()
On Error GoTo ExportToOutlook_Error
Dim objOL As New Outlook.Application
Dim objNS As Outlook.Namespace
Dim objFolder As Outlook.MAPIFolder
Dim objContact As Outlook.ContactItem
Dim objProperty As Outlook.UserProperty
Set objNS = objOL.GetNamespace("MAPI")
Set objFolder =
objNS.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Caledonia
Contacts")
Set objContact = objFolder.Items.Add("IPM.Contact")
objContact.FirstName = "Mark"
objContact.LastName = "Rae"
objContact.Close (olSave)
Set objProperty = objContact.UserProperties.Add("Test", olText, True)
objProperty = "Test"
Set objProperty = objContact.UserProperties.Add("Chelsea", olYesNo, True,
olYesNo)
objProperty = True
ExportToOutlook_Exit:
Set objProperty = Nothing
Set objContact = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objOL = Nothing
Exit Sub
ExportToOutlook_Error:
MsgBox Err.Description, vbCritical + vbOKOnly, "Error In
ExportToOutlook"
Resume ExportToOutlook_Exit
End Sub
Sue Mosher [MVP-Outlook] - 02 Jun 2005 14:05 GMT
You'll kick yourself: You're saving the item before you're setting the custom property values.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
>>Outlook doesn't support importing to a custom form. You'd have to write
>>custom code or use a third-party application. See
[quoted text clipped - 49 lines]
> Resume ExportToOutlook_Exit
> End Sub
Mark Rae - 02 Jun 2005 14:45 GMT
>You'll kick yourself: You're saving the item before you're setting the
>custom property values.
ROTFLMAO!!!
I wish to be known as TAOTH (the anus of the horse) for the rest of the
day...:-)
Mark Rae - 02 Jun 2005 17:01 GMT
Hi Sue,
Can you please tell me how to specify the "This is the mailing address"
functionality when importing from Excel? I'm using the following code:
objContact.BusinessAddressStreet = Range("I" & intRow).Value
If Range("J" & intRow).Value <> "" Then
objContact.BusinessAddressStreet = objContact.BusinessAddressStreet
& vbCrLf & Range("J" & intRow).Value
End If
If Range("K" & intRow).Value <> "" Then
objContact.BusinessAddressStreet = objContact.BusinessAddressStreet
& vbCrLf & Range("K" & intRow).Value
End If
objContact.BusinessAddressCity = Range("L" & intRow).Value
objContact.BusinessAddressState = Range("M" & intRow).Value
objContact.BusinessAddressPostalCode = Range("N" & intRow).Value
objContact.BusinessAddressCountry = Range("O" & intRow).Value
objContact.HomeAddressStreet = Range("P" & intRow).Value
If Range("Q" & intRow).Value <> "" Then
objContact.HomeAddressStreet = objContact.HomeAddressStreet & vbCrLf
& Range("Q" & intRow).Value
End If
If Range("R" & intRow).Value <> "" Then
objContact.HomeAddressStreet = objContact.HomeAddressStreet & vbCrLf
& Range("R" & intRow).Value
End If
objContact.HomeAddressCity = Range("S" & intRow).Value
objContact.HomeAddressState = Range("T" & intRow).Value
objContact.HomeAddressPostalCode = Range("U" & intRow).Value
objContact.HomeAddressCountry = Range("V" & intRow).Value
If there is not a home address, then all is well. However, the business
rules say that if there is a home address, it must be the mailing address. I
tried the following code:
If objContact.HomeAddress <> "" Then
objContact.MailingAddress = objContact.HomeAddress
Else
objContact.MailingAddress = objContact.BusinessAddress
End If
However, that also added a business address and made it the mailing address.
Any assistance gratefully received.
Mark Rae - 02 Jun 2005 22:34 GMT
> Can you please tell me how to specify the "This is the mailing address"
> functionality when importing from Excel? I'm using the following code:
S'OK - I figured it out. It's the SelectedMailingAddress property.