![]() |
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 want to setup a rule/macro that will forward messages to my mobile
phone based on sender's address. Hopefully, I can create an "Important Clients" distribution list and use that as the basis for the rule. So far I did this: Tools-Macro Security- Select Low Launch VBA Editor Tools-References Select Redemption Outlook Library Insert Module Added new sub Public Sub ForwardMsgNoSave(oMailItem As Outlook.MailItem) Dim objSafeMailItem As Redemption.SafeMailItem Dim objFwdMsg As Outlook.MailItem Set objFwdMsg = oMailItem.Forward With objFwdMsg .To = " End With Set objSafeMailItem = CreateObject("Redemption.SafeMailItem") objSafeMailItem.Item = objFwdMsg objSafeMailItem.Send End Sub create a blank rule Apply this rule after message arrives Select conditions (selected none) "This rule will be applied to every message you receive. Is this correct?" Click yes Select actions Select "run a script" Select "Project1.ForwardMsgNoSave" Alt-F11 Set breakpoint on Set objFwdMsg = oMailItem.Forward Send myself a test message and nothing happens What am I doing wrong? Thanks Woody |
#2
|
|||
|
|||
![]()
Am 16 Oct 2006 11:57:03 -0700 schrieb :
Please close Outlook and restart it. Additionally, you must always clean up the Safe*Item objects yourself at the end: Set objSafeMailItem.Item=Nothing Set objSafeMailItem=Nothing -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- I want to setup a rule/macro that will forward messages to my mobile phone based on sender's address. Hopefully, I can create an "Important Clients" distribution list and use that as the basis for the rule. So far I did this: Tools-Macro Security- Select Low Launch VBA Editor Tools-References Select Redemption Outlook Library Insert Module Added new sub Public Sub ForwardMsgNoSave(oMailItem As Outlook.MailItem) Dim objSafeMailItem As Redemption.SafeMailItem Dim objFwdMsg As Outlook.MailItem Set objFwdMsg = oMailItem.Forward With objFwdMsg .To = " End With Set objSafeMailItem = CreateObject("Redemption.SafeMailItem") objSafeMailItem.Item = objFwdMsg objSafeMailItem.Send End Sub create a blank rule Apply this rule after message arrives Select conditions (selected none) "This rule will be applied to every message you receive. Is this correct?" Click yes Select actions Select "run a script" Select "Project1.ForwardMsgNoSave" Alt-F11 Set breakpoint on Set objFwdMsg = oMailItem.Forward Send myself a test message and nothing happens What am I doing wrong? Thanks Woody |
#3
|
|||
|
|||
![]()
"Michael Bauer [MVP - Outlook]" wrote in
news ![]() Am 16 Oct 2006 11:57:03 -0700 schrieb : Please close Outlook and restart it. Additionally, you must always clean up the Safe*Item objects yourself at the end: Set objSafeMailItem.Item=Nothing Set objSafeMailItem=Nothing Thanks. Re-starting outlook did the trick. I wonder why it doesn't have a warning like, "You must restart Outlook for these changes to take effect." |
#4
|
|||
|
|||
![]()
Am Tue, 17 Oct 2006 12:37:46 GMT schrieb Woody:
Why? The warnings are right here in the group :-) -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- "Michael Bauer [MVP - Outlook]" wrote in news ![]() Am 16 Oct 2006 11:57:03 -0700 schrieb : Please close Outlook and restart it. Additionally, you must always clean up the Safe*Item objects yourself at the end: Set objSafeMailItem.Item=Nothing Set objSafeMailItem=Nothing Thanks. Re-starting outlook did the trick. I wonder why it doesn't have a warning like, "You must restart Outlook for these changes to take effect." |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Play a selected sound" in "create Rule" | Trish | Outlook - General Queries | 1 | September 2nd 06 01:37 AM |
Create rule to run script | Dave | Outlook - General Queries | 3 | August 23rd 06 07:41 PM |
Rule 'run a script' not running my script | [email protected] | Outlook and VBA | 3 | May 30th 06 12:09 PM |
Selective Read Receipts VBA using run a script rule | prideoflions | Outlook and VBA | 5 | May 26th 06 03:31 PM |
"Run a script" rule triggers but script does not execute | Trey Shaffer | Outlook and VBA | 7 | April 7th 06 11:34 PM |