Click to See Complete Forum and Search --> : Access 2000 programming - writing data to an Outlook contacts public folder


Richard Vrooman
October 18th, 2001, 10:35 AM
I am trying to write some contact info from an Access 2000 database into to an Outlook 2000 contact Public folder. I've got the VB code set up in a module within the access database. As part of the process I have the following code:

.Account = snpContacts![Client Number]
.Company = snpContacts![Alias Name]
.FirstName = snpContacts![First Name]
.LastName = snpContacts![Last Name]

'-- Copy the email address field if it was entered in the database, make it blank if not

If IsNull(snpContacts![Phone Number]) Then
.[E-Mail] = ""
Else
.[E-Mail] = snpContacts![Phone Number]
End If

The process bombs with a Run-time error 438: "Object doesn't suppor this property or method" on the lines beginning

.Company =

and
.[E-mail] =

If I comment these lines out then the code runs fine. The Company and E-mail fields are in the list of contact item fields. Why would this error occur particularly with these two items? How do I fix this?
Thanks for your help.

Richard Vrooman
October 19th, 2001, 01:23 PM
Problem solved. I had the incorrect variable names.
FYI: use "Companyname" instead of "Company"
and "Email1Address" instead of "E-Mail".
(the number 1 between Email and Address)

Although the names in Outlook are "Company" and "E-Mail", you must program them with the other names.

llama
October 20th, 2001, 12:26 AM
Thanks for posting back..I've been watching this one!