![]() |
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 have posted this to both the outlook and vb groups because I am not
sure of the best way to approach this. I have written a VB program that processes an email based on the customer it is received from, the type of order, etc. I would like the program to start up whenever an email is received by the address I have Outlook set to. Am I better off to wake up my program periodically and check for the emails? Or is there a way to just have Outlook call my program when an email is received? I know how to save the email to a file or database when it is received but I am not aware of how to kick off a program from Outlook when an email is received. I would appreciate all thoughts and pointers to articles or discussions. This seems to fall in between the two programs as I am looking for the best practice. Thank you in advance for your help. |
Ads |
#2
|
|||
|
|||
![]()
The best and most robust way is to use an Outlook COM addin, which can
handle the ItemAdd event in the Items collection of the Inbox. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message news ![]() I have posted this to both the outlook and vb groups because I am not sure of the best way to approach this. I have written a VB program that processes an email based on the customer it is received from, the type of order, etc. I would like the program to start up whenever an email is received by the address I have Outlook set to. Am I better off to wake up my program periodically and check for the emails? Or is there a way to just have Outlook call my program when an email is received? I know how to save the email to a file or database when it is received but I am not aware of how to kick off a program from Outlook when an email is received. I would appreciate all thoughts and pointers to articles or discussions. This seems to fall in between the two programs as I am looking for the best practice. Thank you in advance for your help. |
#3
|
|||
|
|||
![]()
On Wed, 31 Jan 2007 10:11:08 -0500, "Ken Slovak - [MVP - Outlook]"
wrote: The best and most robust way is to use an Outlook COM addin, which can handle the ItemAdd event in the Items collection of the Inbox. Thank you. I've done quite a bit of programming, but never used COM. I will look into that. Do you have a suggestion I might be able to use more quickly? Thanks. |
#4
|
|||
|
|||
![]()
Do you have a suggestion I might be able to use more quickly?
Depending on which version of Outlook you have, you can setup a mail rule to run your program on an incomming email to a specified address. |
#5
|
|||
|
|||
![]()
On Wed, 31 Jan 2007 13:40:56 -0500, "Matt Williamson"
wrote: Do you have a suggestion I might be able to use more quickly? Depending on which version of Outlook you have, you can setup a mail rule to run your program on an incomming email to a specified address. Outlook 2000, Service Pack 3. I will take a look at that. Thanks. |
#6
|
|||
|
|||
![]()
You can prototype your code as a macro that runs automatically in the
Outlook VBA. It would be put in the ThisOutlookSession class. Dim WithEvents colItems As Outlook Items Private Sub Application_Startup() Dim oNS As Outlook.NameSpace Set oNS = Application.GetNameSpace("MAPI") Set colItems = oNS.GetDefaultFolder(olFolderInbox) End Sub Then just select colItems in the left drop-down, ItemAdd in the right drop-down and the prototype of the event handler will be added to the class. The next time you start Outlook it will run for every new item (for 15 or fewer items at a time). Make sure your macro security is set to allow the macro to run. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Bill" wrote in message ... On Wed, 31 Jan 2007 10:11:08 -0500, "Ken Slovak - [MVP - Outlook]" wrote: The best and most robust way is to use an Outlook COM addin, which can handle the ItemAdd event in the Items collection of the Inbox. Thank you. I've done quite a bit of programming, but never used COM. I will look into that. Do you have a suggestion I might be able to use more quickly? Thanks. |
#7
|
|||
|
|||
![]()
On Wed, 31 Jan 2007 19:06:08 -0500, "Ken Slovak - [MVP - Outlook]"
wrote: You can prototype your code as a macro that runs automatically in the Outlook VBA. It would be put in the ThisOutlookSession class. Dim WithEvents colItems As Outlook Items Private Sub Application_Startup() Dim oNS As Outlook.NameSpace Set oNS = Application.GetNameSpace("MAPI") Set colItems = oNS.GetDefaultFolder(olFolderInbox) End Sub Then just select colItems in the left drop-down, ItemAdd in the right drop-down and the prototype of the event handler will be added to the class. The next time you start Outlook it will run for every new item (for 15 or fewer items at a time). Make sure your macro security is set to allow the macro to run. Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
sharing specific calendars with specific people. | Snyder | Outlook - Calandaring | 2 | October 31st 06 07:03 PM |
Enforce Specific Encoding To Messages Arrived From Specific Addres | Gil | Outlook and VBA | 3 | April 26th 06 04:00 PM |
Moving Specific Inbox Items to a Specific Subfolder (VBA) | DevDaniel | Outlook and VBA | 1 | April 11th 06 06:46 AM |
Trying to write a program that would collect images received as email attachments | Vanessa Lee | Outlook and VBA | 3 | February 20th 06 11:59 PM |
How to make Windows/IE default email program profile specific? | @Echo Off | Outlook Express | 2 | January 25th 06 07:11 PM |