Contact Program
1. retrieve addresses from emails
From an individual e-mail, use Item.SenderEmailAddress.
To retrieve from all e-mails, loop through the MAPIFolder.Items collection
for the folder you want to inspect
2. Check for the address in the contacts list
Use a loop through the Items collection from the Contacts folder. Use
Items.Restrict("[Email1Address = '") to filter the collection.
Repeat with Email2Address and Email3Address. OR - use Redemption
(www.dimastr.com) - which has a handy RDOAddressEntry.GetContact method.
3. run a form that will prompt "would you like to add as contact"
You don't need to design a form for this, unless you really need to
customize the dialog. Use the MsgBox method.
4. when you click yes, opens the standard "add contact" form with the email
already filled out (this one is optional)
Use something like:
Set objContact = olApp.CreateItem(olContactItem)
objContact.Email1Address = strEmail
objContact.Display
--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
"BrianL" wrote:
I have found this post to be very helpful to me as I try to write a script
for an employee. I havn't done any VB coding since I was 12 however and I'm a
bit rusty (I'm fixing that by reading VBA in a Nutshell)
A couple days ago an employee asked if there was a way to get Outlook to
prompt you when you recieve an e-mail from someone who is not in your contact
list.
We downloaded an add-on that adds contacts from all messages sent and
recieved, but it hasn't worked out to well.
My Goal for this script:
1. retrieve addresses from emails
2. Check for the address in the contacts list
3. run a form that will prompt "would you like to add as contact"
4. when you click yes, opens the standard "add contact" form with the email
already filled out (this one is optional)
I already have the Prompt form created and have named it addprompt. The only
script I have right now is the script for the "no" button.
any advice on how to achieve my goal would be greatly apreciated
|