A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Contact Program



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 1st 06, 07:31 PM posted to microsoft.public.outlook.program_vba
FLSusanC
external usenet poster
 
Posts: 3
Default Contact Program

I wonder if this would accomplish the same for my needs: for every person
that wants to be added to our mailing list and completes the "join our
mailing list" form on the website, the infomation will automatically be added
as a new contact in Outlook. Would it be smarter to use a separate contact
folder or use a category to filter them later?
Thank you for your advise.

"Eric Legault [MVP - Outlook]" wrote:

You need to change your macro security settings to Medium or lower to run
macros.

Do you want these Contacts created only when e-mails are received in your
Inbox, or moved to those sub-folders? Or do you need to create them in one
shot as a batch, running the batch once for every folder containing the
e-mails?

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Brent E" wrote:

Sounds Magnificent. I really appreciate your assitance, Eric. I am also
running 2003 and am curious. I've pasted these procedures into my
ThisOutlookSession module and restarted Outlook, but this won't seem to run
automatcially, what command should I use to launch this? I tried lookin in my
macros window but was blank. I also thought of running these procedures name
from the Immediate window in the VBE, but I get an error saying "Macros not
enabled in this project".

Also, this is basically what I am trying to get to: a module that will do
the following:
I've got 3 Inboxes setup which get email from 3 different sources.
These Inboxes are named "ERealty", "Realtor.com" and "Website"
I need to create contacts from all emails in each Inbox and save these
contacts in corresponding Outlook contact folders, named similarly (e.g.
"ERealty", "Realtor.com" and "Website")
So we have Inboxes and Contact Folders w/ these names.
These Inboxes and Contact folders are already created and in place.
So I need to create a module that will automatically generate contacts from
each Inbox and save them in their proper Contact folder. ? I really
appreciate your assistance

"Eric Legault [MVP - Outlook]" wrote:

You don't need to select the folders at all. If all you want is to create a
new Contact from all incoming messages and save it in the default Contacts
folder, you can do so by pasting this code into your ThisOutlookSession
module in the Outlook VBA Editor:

Option Explicit
Dim WithEvents NewMailItems As Outlook.Items

Private Sub Application_Startup()
Set NewMailItems =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderInbox).Items
End Sub

Private Sub NewMailItems_ItemAdd(ByVal Item As Object)
'THIS WILL FIRE FOR EVERY NEW E-MAIL; YOU CAN USE THE
'Item OBJECT TO WORK WITH THE PROPERTIES OF THE E-MAIL MESSAGE

Dim objContact As Outlook.ContactItem
Dim objMsg As Outlook.MailItem

If Item.Class olMail Then Exit Sub

Set objContact = Application.CreateItem(olContactItem)
Set objMsg = Item

objContact.FullName = objMsg.SenderName
objContact.Email1Address = objMsg.SenderEmailAddress
objContact.Save

Set objContact = Nothing
Set objMsg = Nothing
End Sub

Note that the ItemAdd event is not guaranteed to fire if a large number of
messages are delivered at once. Also, if you do not have Outlook 2003 a
security warning will pop up when the code tries to access the
SenderEmailAddress property. For ways to bypass this, see:

Microsoft Outlook "Object Model Guard" Security Issues for Developers:
http://www.outlookcode.com/d/sec.htm

And for some great starting resources on Outlook programming, see:

Visual Basic and VBA Coding in Microsoft Outlook:
http://www.outlookcode.com/d/vb.htm

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Brent E" wrote:

Good morning,

I am really new to VBA for Outlook. I am trying to create a macro/module
that will:
Automatically select the contacts folder,
Select Inbox titled "Realtor.com"
Create a contact from each email that comes into this Inbox.
I am not sure what commands or syntax to use. Would this be a simple
program? Suggestions would be really appreciated. Thanks.

Cordially,

Ads
  #2  
Old February 1st 06, 08:54 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Contact Program

Wow, an old thread resurrected! :-)

It depends on how this form is processed on your web site. Do the results
get sent to someone internally via e-mail?

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"FLSusanC" wrote:

I wonder if this would accomplish the same for my needs: for every person
that wants to be added to our mailing list and completes the "join our
mailing list" form on the website, the infomation will automatically be added
as a new contact in Outlook. Would it be smarter to use a separate contact
folder or use a category to filter them later?
Thank you for your advise.

"Eric Legault [MVP - Outlook]" wrote:

You need to change your macro security settings to Medium or lower to run
macros.

Do you want these Contacts created only when e-mails are received in your
Inbox, or moved to those sub-folders? Or do you need to create them in one
shot as a batch, running the batch once for every folder containing the
e-mails?

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Brent E" wrote:

Sounds Magnificent. I really appreciate your assitance, Eric. I am also
running 2003 and am curious. I've pasted these procedures into my
ThisOutlookSession module and restarted Outlook, but this won't seem to run
automatcially, what command should I use to launch this? I tried lookin in my
macros window but was blank. I also thought of running these procedures name
from the Immediate window in the VBE, but I get an error saying "Macros not
enabled in this project".

Also, this is basically what I am trying to get to: a module that will do
the following:
I've got 3 Inboxes setup which get email from 3 different sources.
These Inboxes are named "ERealty", "Realtor.com" and "Website"
I need to create contacts from all emails in each Inbox and save these
contacts in corresponding Outlook contact folders, named similarly (e.g.
"ERealty", "Realtor.com" and "Website")
So we have Inboxes and Contact Folders w/ these names.
These Inboxes and Contact folders are already created and in place.
So I need to create a module that will automatically generate contacts from
each Inbox and save them in their proper Contact folder. ? I really
appreciate your assistance

"Eric Legault [MVP - Outlook]" wrote:

You don't need to select the folders at all. If all you want is to create a
new Contact from all incoming messages and save it in the default Contacts
folder, you can do so by pasting this code into your ThisOutlookSession
module in the Outlook VBA Editor:

Option Explicit
Dim WithEvents NewMailItems As Outlook.Items

Private Sub Application_Startup()
Set NewMailItems =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderInbox).Items
End Sub

Private Sub NewMailItems_ItemAdd(ByVal Item As Object)
'THIS WILL FIRE FOR EVERY NEW E-MAIL; YOU CAN USE THE
'Item OBJECT TO WORK WITH THE PROPERTIES OF THE E-MAIL MESSAGE

Dim objContact As Outlook.ContactItem
Dim objMsg As Outlook.MailItem

If Item.Class olMail Then Exit Sub

Set objContact = Application.CreateItem(olContactItem)
Set objMsg = Item

objContact.FullName = objMsg.SenderName
objContact.Email1Address = objMsg.SenderEmailAddress
objContact.Save

Set objContact = Nothing
Set objMsg = Nothing
End Sub

Note that the ItemAdd event is not guaranteed to fire if a large number of
messages are delivered at once. Also, if you do not have Outlook 2003 a
security warning will pop up when the code tries to access the
SenderEmailAddress property. For ways to bypass this, see:

Microsoft Outlook "Object Model Guard" Security Issues for Developers:
http://www.outlookcode.com/d/sec.htm

And for some great starting resources on Outlook programming, see:

Visual Basic and VBA Coding in Microsoft Outlook:
http://www.outlookcode.com/d/vb.htm

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Brent E" wrote:

Good morning,

I am really new to VBA for Outlook. I am trying to create a macro/module
that will:
Automatically select the contacts folder,
Select Inbox titled "Realtor.com"
Create a contact from each email that comes into this Inbox.
I am not sure what commands or syntax to use. Would this be a simple
program? Suggestions would be really appreciated. Thanks.

Cordially,

  #3  
Old February 1st 06, 09:12 PM posted to microsoft.public.outlook.program_vba
FLSusanC
external usenet poster
 
Posts: 3
Default Contact Program

Currently contact information is entered when people donate monies thru the
link on our site using PayPal. I will have to check with the Web designer to
be sure.

What will need to happen?
Have you heard of the Constant Contact program?

"Eric Legault [MVP - Outlook]" wrote:

Wow, an old thread resurrected! :-)

It depends on how this form is processed on your web site. Do the results
get sent to someone internally via e-mail?

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"FLSusanC" wrote:

I wonder if this would accomplish the same for my needs: for every person
that wants to be added to our mailing list and completes the "join our
mailing list" form on the website, the infomation will automatically be added
as a new contact in Outlook. Would it be smarter to use a separate contact
folder or use a category to filter them later?
Thank you for your advise.

"Eric Legault [MVP - Outlook]" wrote:

You need to change your macro security settings to Medium or lower to run
macros.

Do you want these Contacts created only when e-mails are received in your
Inbox, or moved to those sub-folders? Or do you need to create them in one
shot as a batch, running the batch once for every folder containing the
e-mails?

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Brent E" wrote:

Sounds Magnificent. I really appreciate your assitance, Eric. I am also
running 2003 and am curious. I've pasted these procedures into my
ThisOutlookSession module and restarted Outlook, but this won't seem to run
automatcially, what command should I use to launch this? I tried lookin in my
macros window but was blank. I also thought of running these procedures name
from the Immediate window in the VBE, but I get an error saying "Macros not
enabled in this project".

Also, this is basically what I am trying to get to: a module that will do
the following:
I've got 3 Inboxes setup which get email from 3 different sources.
These Inboxes are named "ERealty", "Realtor.com" and "Website"
I need to create contacts from all emails in each Inbox and save these
contacts in corresponding Outlook contact folders, named similarly (e.g.
"ERealty", "Realtor.com" and "Website")
So we have Inboxes and Contact Folders w/ these names.
These Inboxes and Contact folders are already created and in place.
So I need to create a module that will automatically generate contacts from
each Inbox and save them in their proper Contact folder. ? I really
appreciate your assistance

"Eric Legault [MVP - Outlook]" wrote:

You don't need to select the folders at all. If all you want is to create a
new Contact from all incoming messages and save it in the default Contacts
folder, you can do so by pasting this code into your ThisOutlookSession
module in the Outlook VBA Editor:

Option Explicit
Dim WithEvents NewMailItems As Outlook.Items

Private Sub Application_Startup()
Set NewMailItems =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderInbox).Items
End Sub

Private Sub NewMailItems_ItemAdd(ByVal Item As Object)
'THIS WILL FIRE FOR EVERY NEW E-MAIL; YOU CAN USE THE
'Item OBJECT TO WORK WITH THE PROPERTIES OF THE E-MAIL MESSAGE

Dim objContact As Outlook.ContactItem
Dim objMsg As Outlook.MailItem

If Item.Class olMail Then Exit Sub

Set objContact = Application.CreateItem(olContactItem)
Set objMsg = Item

objContact.FullName = objMsg.SenderName
objContact.Email1Address = objMsg.SenderEmailAddress
objContact.Save

Set objContact = Nothing
Set objMsg = Nothing
End Sub

Note that the ItemAdd event is not guaranteed to fire if a large number of
messages are delivered at once. Also, if you do not have Outlook 2003 a
security warning will pop up when the code tries to access the
SenderEmailAddress property. For ways to bypass this, see:

Microsoft Outlook "Object Model Guard" Security Issues for Developers:
http://www.outlookcode.com/d/sec.htm

And for some great starting resources on Outlook programming, see:

Visual Basic and VBA Coding in Microsoft Outlook:
http://www.outlookcode.com/d/vb.htm

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Brent E" wrote:

Good morning,

I am really new to VBA for Outlook. I am trying to create a macro/module
that will:
Automatically select the contacts folder,
Select Inbox titled "Realtor.com"
Create a contact from each email that comes into this Inbox.
I am not sure what commands or syntax to use. Would this be a simple
program? Suggestions would be really appreciated. Thanks.

Cordially,

  #4  
Old February 1st 06, 11:38 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Contact Program

Ultimately you need that web form to send an e-mail to someone internally.
This e-mail would contain the e-mail address of the user who submitted the
form somewhere - in the subject or message body. The macro I wrote earlier
in this thread would be perfect to auto-create Contacts based on these
incoming e-mails, however it would have to be tweaked to parse the subject
line or message body to read the user e-mail, and it would not be coming from
the user (the e-mail would be coming from whatever e-mail account was used on
the web server to send that internal e-mail). The macro would also need to
run on the computer that is running the Outlook profile connected to the
e-mail account that receives the results of the web forms.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"FLSusanC" wrote:

Currently contact information is entered when people donate monies thru the
link on our site using PayPal. I will have to check with the Web designer to
be sure.

What will need to happen?
Have you heard of the Constant Contact program?

"Eric Legault [MVP - Outlook]" wrote:

Wow, an old thread resurrected! :-)

It depends on how this form is processed on your web site. Do the results
get sent to someone internally via e-mail?

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"FLSusanC" wrote:

I wonder if this would accomplish the same for my needs: for every person
that wants to be added to our mailing list and completes the "join our
mailing list" form on the website, the infomation will automatically be added
as a new contact in Outlook. Would it be smarter to use a separate contact
folder or use a category to filter them later?
Thank you for your advise.

"Eric Legault [MVP - Outlook]" wrote:

You need to change your macro security settings to Medium or lower to run
macros.

Do you want these Contacts created only when e-mails are received in your
Inbox, or moved to those sub-folders? Or do you need to create them in one
shot as a batch, running the batch once for every folder containing the
e-mails?

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Brent E" wrote:

Sounds Magnificent. I really appreciate your assitance, Eric. I am also
running 2003 and am curious. I've pasted these procedures into my
ThisOutlookSession module and restarted Outlook, but this won't seem to run
automatcially, what command should I use to launch this? I tried lookin in my
macros window but was blank. I also thought of running these procedures name
from the Immediate window in the VBE, but I get an error saying "Macros not
enabled in this project".

Also, this is basically what I am trying to get to: a module that will do
the following:
I've got 3 Inboxes setup which get email from 3 different sources.
These Inboxes are named "ERealty", "Realtor.com" and "Website"
I need to create contacts from all emails in each Inbox and save these
contacts in corresponding Outlook contact folders, named similarly (e.g.
"ERealty", "Realtor.com" and "Website")
So we have Inboxes and Contact Folders w/ these names.
These Inboxes and Contact folders are already created and in place.
So I need to create a module that will automatically generate contacts from
each Inbox and save them in their proper Contact folder. ? I really
appreciate your assistance

"Eric Legault [MVP - Outlook]" wrote:

You don't need to select the folders at all. If all you want is to create a
new Contact from all incoming messages and save it in the default Contacts
folder, you can do so by pasting this code into your ThisOutlookSession
module in the Outlook VBA Editor:

Option Explicit
Dim WithEvents NewMailItems As Outlook.Items

Private Sub Application_Startup()
Set NewMailItems =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderInbox).Items
End Sub

Private Sub NewMailItems_ItemAdd(ByVal Item As Object)
'THIS WILL FIRE FOR EVERY NEW E-MAIL; YOU CAN USE THE
'Item OBJECT TO WORK WITH THE PROPERTIES OF THE E-MAIL MESSAGE

Dim objContact As Outlook.ContactItem
Dim objMsg As Outlook.MailItem

If Item.Class olMail Then Exit Sub

Set objContact = Application.CreateItem(olContactItem)
Set objMsg = Item

objContact.FullName = objMsg.SenderName
objContact.Email1Address = objMsg.SenderEmailAddress
objContact.Save

Set objContact = Nothing
Set objMsg = Nothing
End Sub

Note that the ItemAdd event is not guaranteed to fire if a large number of
messages are delivered at once. Also, if you do not have Outlook 2003 a
security warning will pop up when the code tries to access the
SenderEmailAddress property. For ways to bypass this, see:

Microsoft Outlook "Object Model Guard" Security Issues for Developers:
http://www.outlookcode.com/d/sec.htm

And for some great starting resources on Outlook programming, see:

Visual Basic and VBA Coding in Microsoft Outlook:
http://www.outlookcode.com/d/vb.htm

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


"Brent E" wrote:

Good morning,

I am really new to VBA for Outlook. I am trying to create a macro/module
that will:
Automatically select the contacts folder,
Select Inbox titled "Realtor.com"
Create a contact from each email that comes into this Inbox.
I am not sure what commands or syntax to use. Would this be a simple
program? Suggestions would be really appreciated. Thanks.

Cordially,

  #5  
Old June 14th 07, 03:11 PM posted to microsoft.public.outlook.program_vba
BrianL
external usenet poster
 
Posts: 13
Default Contact Program

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
  #6  
Old June 14th 07, 09:58 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default 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

  #7  
Old June 14th 07, 10:15 PM posted to microsoft.public.outlook.program_vba
BrianL
external usenet poster
 
Posts: 13
Default Contact Program

I did not realize it, but I have this question twice in the newsgroup haha.
Sue M. gave me the idea to make the first steps more simple: just have a
rule that applies to every message, and make an exception for emails sent by
a contact. If it isn't in the contact list, then I will run the msgbox /
script to actually add the contact.

We havn't completely finished discusing it, but the code you provided will
give me good ground to build on. I really appreciate your input here =].

"Eric Legault [MVP - Outlook]" wrote:

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/



  #8  
Old June 14th 07, 10:33 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Contact Program

Right, if you use those rule condition/exceptions, you won't have to do Step #2 at all.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"BrianL" wrote in message ...
I did not realize it, but I have this question twice in the newsgroup haha.
Sue M. gave me the idea to make the first steps more simple: just have a
rule that applies to every message, and make an exception for emails sent by
a contact. If it isn't in the contact list, then I will run the msgbox /
script to actually add the contact.

We havn't completely finished discusing it, but the code you provided will
give me good ground to build on. I really appreciate your input here =].

"Eric Legault [MVP - Outlook]" wrote:

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/



  #9  
Old June 15th 07, 02:54 PM posted to microsoft.public.outlook.program_vba
BrianL
external usenet poster
 
Posts: 13
Default Contact Program

Thanks for all of your help here guys. The code that Eric gave me and the new
approach Sue contributed will help me greatly.

I would sit here and ask you to hold my hand through writing this code, but
where's the accomplishment in that? haha

Thanks again,

Brian L (the 16 year old programmer :-P )

"Sue Mosher [MVP-Outlook]" wrote:

Right, if you use those rule condition/exceptions, you won't have to do Step #2 at all.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



  #10  
Old June 15th 07, 03:05 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Contact Program

We'll be here if you get stumped, Brian. Have fun.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"BrianL" wrote in message ...
Thanks for all of your help here guys. The code that Eric gave me and the new
approach Sue contributed will help me greatly.

I would sit here and ask you to hold my hand through writing this code, but
where's the accomplishment in that? haha

Thanks again,

Brian L (the 16 year old programmer :-P )

"Sue Mosher [MVP-Outlook]" wrote:

Right, if you use those rule condition/exceptions, you won't have to do Step #2 at all.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting appts from another program Feene Outlook - Calandaring 1 March 8th 06 09:06 PM
My program runs very slow קובץ Outlook and VBA 6 January 22nd 06 04:46 PM
Open program with ... Ann Outlook Express 3 January 18th 06 06:24 PM
How to Program a Calendar Control Chaplain Doug Outlook - Using Forms 1 January 12th 06 03:53 PM
Address book program with CRM features to replace Outlook/Express contact book [email protected] Outlook - Using Contacts 0 January 11th 06 12:36 AM


All times are GMT +1. The time now is 11:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.