Solved

Copy one Contact field to another w/ VBA???

Posted on 2004-04-12
5
233 Views
Last Modified: 2010-04-08
Hello all,

I'm just starting to get the hang of VBA in MS Access...I haven't tried it in Outlook yet, so I don't know the differences (if there are any) between the two.

I'm bringing data over from an employee database into a shared public contacts folder.  Whenever I bing the data over, everyone's birthday gets entered into my calendar (probably because I'm populating the [Birthdate] field with data from the Employee Database).

Here's the thing....my boss would like the birthdate in his calendar, I would not.....whenever I update the contacts list (from MS Access) I get the birthdays and my boss doesn't (probably because I'm performing the code that's bringing over the contacts from MS Access)

Currently, I was trying to bring over the employee's birthdate as ContactItem.[User1], and then I was going to try and write code to copy that value to the birthdate field:
ContactItem.[User1] = ContactItem.[Birthdate] and have that code executed on a button click or something

Does that sound like something logical? -er doable?  Or should I try a different avenue?

If I were to write code to go behind a button....which variables should I declare in outlook??

Any help would be appreciated....

MW
0
Comment
Question by:wolfeman76
5 Comments
 
LVL 13

Accepted Solution

by:
stefri earned 250 total points
ID: 10808996
the right coding will be
thisContact.user1 = thisContact.Birthday
Doing so, you copy birthday to user1 but I understand you want to copy user1 to birthday:
thisContact.birthday = thisContact.user1
May be do you have to cast user1 value to date using cdate(thisContact.user1)

Try to avoid ContactItem as variable name as it is an Outlook Class

You should declare thisContact as Outlook.ContactItem (see View/Object Viewer in VBA Editor)

Stefri
0
 
LVL 1

Author Comment

by:wolfeman76
ID: 10812431
I was hoping to do more like a global...Can I do a Do...Loop in OL?  What would I declare as the DB?

Thanks,

MW
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now