Sue, thanks for replying so quickly!
In response to your queries...
need to be identical to those defined in your custom form.
I had a spreadsheet with a list of all the user-defined fields required and
their data types, which I used to "copy and paste" the names when creating
the fields. It's possible I made a mistake when using this. If I find that I
have made a typo, presumably I could;
(1) create the field in the folder
(2) write some code that would iterate through each contact item to create
the new field, set it's value to the one in the incorrect field and then
remove the old field
(3) publish a new version of the form using the new field
??
MAPIFolder.Items.Add statement, right?
Erm, no. I used the Oulook Object Library, rather than CDO, so my code looks
something like this;
Dim outOutlook As Outlook.Application
Dim outContactsFolder As Outlook.mapiFolder
Dim outContact As Outlook.ContactItem
Dim outContact As Outlook.ContactItem
Dim outUserProperty As Outlook.ItemProperty
Set outOutlook = New Outlook.Application
Set outNamespace = outOutlook.GetNamespace("MAPI")
Set outContactsFolder = outNamespace.GetFolderFromID(strDestinationFolderID)
# loop through contacts in database
Set outContact = outContactsFolder.Items.Add()
# loop through fields to be set
# if field is user-defined
Set outUserProperty =
outContact.UserProperties.Add(#FieldName#,#FieldType#,True)
outUserProperty.Value = #FieldValue#
# else
outContact.ItemProperties(#FieldName#).Value = #FieldValue#
# end if
#next
outContact.MessageClass = #CustomFormClass#
outContact.Save
Set outContact = Nothing
#next
I've used the # to pseudo-ise(!) the code. I use a mapping database to
define the Outlook field into which the ACT data is written, hence the "#
loop through fields to be set".
form for which no icon was defined.
Does that mean that there is a way of defining an icon to be used by a
custom form?
I will, as soon as the company provides me with VPN access to the network
and Exchange server!
Cheers,
Phil