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

Rule 'run a script' not running my script



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 25th 06, 01:38 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 1
Default Rule 'run a script' not running my script

I'm trying to use the VBA script below to create a TaskItem from an
email when a particular one of my rules gets triggered. However, it
appears as if the script is never run. Any thoughts? I've tried
tweaking various security settings but this hasn't appeared to help.

Public Sub CreateTaskForEmail(eMail As MailItem)
Dim Task As Outlook.TaskItem
Set Task = ThisOutlookSession.CreateItem(olTaskItem)

'Create a task that will remind me to look at it tomorrow
With Task
.Subject = eMail.Subject
.Body = eMail.Body
.DueDate = DateTime.DateAdd("d", 1, Now)
.ReminderSet = True
.ReminderTime = "10:00"
.Save
End With
End Sub

Ads
  #2  
Old May 25th 06, 07:40 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Rule 'run a script' not running my script

After you change the macro security settings, you must restart Outlook. Did you do that?

What about a simple procedure with just a MsgBox statement? Does that run?

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

wrote in message ups.com...
I'm trying to use the VBA script below to create a TaskItem from an
email when a particular one of my rules gets triggered. However, it
appears as if the script is never run. Any thoughts? I've tried
tweaking various security settings but this hasn't appeared to help.

Public Sub CreateTaskForEmail(eMail As MailItem)
Dim Task As Outlook.TaskItem
Set Task = ThisOutlookSession.CreateItem(olTaskItem)

'Create a task that will remind me to look at it tomorrow
With Task
.Subject = eMail.Subject
.Body = eMail.Body
.DueDate = DateTime.DateAdd("d", 1, Now)
.ReminderSet = True
.ReminderTime = "10:00"
.Save
End With
End Sub

  #3  
Old May 26th 06, 04:05 PM posted to microsoft.public.outlook.program_vba
scottp
external usenet poster
 
Posts: 2
Default Rule 'run a script' not running my script

Thanks Sue - It was the restart Outlook step I was missing!!

  #4  
Old May 30th 06, 01:09 PM posted to microsoft.public.outlook.program_vba
scottp
external usenet poster
 
Posts: 2
Default Rule 'run a script' not running my script

Am alternative approach I found was to Self Sign the script for use on
my computer - allowing me to keep my security settings.

See
http://www.microsoft.com/technet/pro.../vbamacro.mspx
for full details.

The basic approach is to use C:\Program Files\Microsoft
Office\OFFICE11\selfcert.exe to create the digital signature and then
select this inside Outlook.

Hope this is of use to people.

Scott

 




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
Selective Read Receipts VBA using run a script rule prideoflions Outlook and VBA 5 May 26th 06 04:31 PM
Script error while running .Net Code Muhammad Usman Outlook - Using Forms 1 May 4th 06 01:17 PM
"Run a script" rule triggers but script does not execute Trey Shaffer Outlook and VBA 7 April 8th 06 12:34 AM
Problem running a VBA script from an Outlook rule Olivier Langlois Outlook and VBA 5 March 16th 06 10:03 PM
Problem running a VBA script from an Outlook rule Olivier Langlois Add-ins for Outlook 5 March 16th 06 10:03 PM


All times are GMT +1. The time now is 04:49 PM.


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.