Solved

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

Posted on 2004-04-12
5
232 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
If you don't know how to downgrade, my instructions below should be helpful.
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 …

747 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

12 Experts available now in Live!

Get 1:1 Help Now