![]() |
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 would like to create a rule for Outlook 2003 which will send an email if
certain conditions within the rule are met. The destination address will be static, as will everything in the email. I basically want to create an Outlook rule that says "If email from xxx is received run script" And I want the script to send an email that says "You received an important email." This same message is always sent to the same email address. Seems to me that this would be a very basic script. But I have no idea if such a script is programmatically possible for Outlook. I have experience with VB Script (as well as C++ and lots of other programming) but I don't know the first thing about writing scripts for Outlook. If what I want to do is possible, let me know and I'll start researching. If what I want to do is possible and you want to be extra helpful, let me know and give me some pointers to get me started :-) |
#2
|
|||
|
|||
![]()
A "run a script" rule action actually uses not an external script but a VBA procedure with a MailItem or MeetingItem as its parameter. That item is processed by the code:
Sub RunAScriptRuleRoutine(MyMail As MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim msg As Outlook.MailItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set msg = olNS.GetItemFromID(strID) ' do stuff with msg, e.g. MsgBox msg.SUbject Set msg = Nothing Set olNS = Nothing End Sub Of course, in your scenario, you don't seem to care about the item, so all you need to do is create a message and send it: Set mail = Application.CreateItem(olMail) With mail .To = " .Subject = "whatever" .Body = "some stuff" .Send End With -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Roy N" wrote in message ... I would like to create a rule for Outlook 2003 which will send an email if certain conditions within the rule are met. The destination address will be static, as will everything in the email. I basically want to create an Outlook rule that says "If email from xxx is received run script" And I want the script to send an email that says "You received an important email." This same message is always sent to the same email address. Seems to me that this would be a very basic script. But I have no idea if such a script is programmatically possible for Outlook. I have experience with VB Script (as well as C++ and lots of other programming) but I don't know the first thing about writing scripts for Outlook. If what I want to do is possible, let me know and I'll start researching. If what I want to do is possible and you want to be extra helpful, let me know and give me some pointers to get me started :-) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Script errors arriving in email? | Dick | Outlook Express | 9 | May 23rd 07 11:55 AM |
Rule 'run a script' not running my script | [email protected] | Outlook and VBA | 3 | May 30th 06 12:09 PM |
sending email alerts from Sql Server | helpful sql | Outlook - General Queries | 8 | April 12th 06 04:10 AM |
Junk email and rules and alerts... | annoyed | Outlook - Installation | 1 | February 8th 06 07:56 PM |
Email alerts for messages directly send to me. Outlook 2003 | [email protected] | Outlook - General Queries | 1 | January 31st 06 11:02 PM |