Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

830 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