Solved

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

Posted on 2004-04-12
5
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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…
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…

691 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