![]() |
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
|
|||
|
|||
![]()
One of the easiest ways is to use a "run a script" rule in Rules Wizard to run 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 See http://www.outlookcode.com/d/code/zaphtml.htm#ol2002 for another example. -- 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 "White Horse" wrote in message oups.com... Can the receipt of an e-mail run a macro, and if so, could someone post sample code? |
#2
|
|||
|
|||
![]()
Thanks Sue! Your tip solved my problem. I'm posting a new help
request for printing image attachments. Hope I hear from you on this one. Mike |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Selective Read Receipts VBA using run a script rule | prideoflions | Outlook and VBA | 5 | May 26th 06 04:31 PM |
Run VBA Code from 'new mail message' on standard toolbar | Carmi | Outlook and VBA | 8 | March 31st 06 06:53 PM |
Message Rule Does Not Run VBA Procedure | Lowell | Outlook and VBA | 18 | March 9th 06 07:47 PM |
Automatically trigger a VBA macro to run when connection to exchange server has been made. | [email protected] | Outlook and VBA | 1 | January 30th 06 11:29 PM |
Automatically trigger a VBA macro to run when connection to exchange server has been made. | [email protected] | Outlook and VBA | 0 | January 25th 06 09:52 PM |