![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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, |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Exporting appts from another program | Feene | Outlook - Calandaring | 1 | March 8th 06 08:06 PM |
My program runs very slow | קובץ | Outlook and VBA | 6 | January 22nd 06 03:46 PM |
Open program with ... | Ann | Outlook Express | 3 | January 18th 06 05:24 PM |
How to Program a Calendar Control | Chaplain Doug | Outlook - Using Forms | 1 | January 12th 06 02:53 PM |
Address book program with CRM features to replace Outlook/Express contact book | [email protected] | Outlook - Using Contacts | 0 | January 10th 06 11:36 PM |