A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

"run a script" rule won't fire macro



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 16th 06, 07:57 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 1
Default "run a script" rule won't fire macro

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  
Old October 17th 06, 05:49 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default "run a script" rule won't fire macro

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

  #4  
Old October 18th 06, 06:08 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default "run a script" rule won't fire macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 10:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.