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 not listed in rules wizard



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 4th 09, 10:56 PM posted to microsoft.public.outlook.program_vba
laavista
external usenet poster
 
Posts: 15
Default Run A Script not listed in rules wizard

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this option
when I go into rules, and I would really like to use it.

Any suggestions?

Thanks, in advance, for your help.
Ads
  #2  
Old July 6th 09, 07:07 PM posted to microsoft.public.outlook.program_vba
Alan Moseley
external usenet poster
 
Posts: 61
Default Run A Script not listed in rules wizard

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this option
when I go into rules, and I would really like to use it.

Any suggestions?

Thanks, in advance, for your help.

  #3  
Old July 7th 09, 04:43 AM posted to microsoft.public.outlook.program_vba
laavista
external usenet poster
 
Posts: 15
Default STILL IS NOT AVAILABLE... Run A Script not listed in rules wizard

I went through the steps you outlined multiple times, and there's no "run a
script" rule. I wonder if my company "turned off" this option?

I was hoping to use this as the VBA procedure I wrote results in the Outlook
Security Warning and is useless because of the warnings (my user would have
to click 'yes' 400+ times a month). I thought by using the RunAScript rule
it may prevent the warnings.

Thanks for responding.



"Alan Moseley" wrote:

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this option
when I go into rules, and I would really like to use it.

Any suggestions?

Thanks, in advance, for your help.

  #4  
Old July 7th 09, 05:53 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default STILL IS NOT AVAILABLE... Run A Script not listed in rules wizard

Are you trying to create a rule for outgoing messages? The "run a script"
action is available only for incoming messages.

If you're getting security prompts with normal Outlook VBA code, using the
"run a script" rule isn't necessarily going to get around that. Maybe your
VBA code simply isn't constructed properly to derive all objects from the
intrinsic Application object. You might also want to tell us the security
state shown on the Help | About Microsoft Outlook dialog.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"laavista" wrote in message
...
I went through the steps you outlined multiple times, and there's no "run a
script" rule. I wonder if my company "turned off" this option?

I was hoping to use this as the VBA procedure I wrote results in the
Outlook
Security Warning and is useless because of the warnings (my user would
have
to click 'yes' 400+ times a month). I thought by using the RunAScript
rule
it may prevent the warnings.

"Alan Moseley" wrote:

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.



"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this
option
when I go into rules, and I would really like to use it.



  #5  
Old July 7th 09, 10:30 AM posted to microsoft.public.outlook.program_vba
Alan Moseley
external usenet poster
 
Posts: 61
Default STILL IS NOT AVAILABLE... Run A Script not listed in rules wizard

If your script is written within Outlook VBA then it should be possible to
write your code so that the warnings do not appear. Do you have any lines of
code similar to:-

Set objOutlook = New Outlook.Application
or
Set objOutlook = CreateObject("Outlook.Application")

If so then try changing this to:-

Set objOutlook=Outlook

If you then create further objects from this, such as:-

Set objNamespace = Outlook.GetNameSpace("MAPI")
Set objContacts = objNamespace.GetDefaultFolder(olFolderContacts).It ems

and so on, you will prevent the security warning from being shown as
'Outlook' is an in-built object that picks up a reference to the currently
running Outlook application.

If you need any further assistance then post your code and I will see what
needs changing.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I went through the steps you outlined multiple times, and there's no "run a
script" rule. I wonder if my company "turned off" this option?

I was hoping to use this as the VBA procedure I wrote results in the Outlook
Security Warning and is useless because of the warnings (my user would have
to click 'yes' 400+ times a month). I thought by using the RunAScript rule
it may prevent the warnings.

Thanks for responding.



"Alan Moseley" wrote:

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this option
when I go into rules, and I would really like to use it.

Any suggestions?

Thanks, in advance, for your help.

  #6  
Old July 7th 09, 09:20 PM posted to microsoft.public.outlook.program_vba
laavista
external usenet poster
 
Posts: 15
Default STILL IS NOT AVAILABLE... Run A Script not listed in rules wiz

Alan, you do not know how much I appreciate you looking at my code to see if
the security warnings can be eliminated. I REALLY need to get this working
and have spent hours (and hours) trying things, researching, and trying more
things, with no luck. THANK YOU.

The reason I need this-- I have several users who send 400+ emails a month
to customers with attachments. In order for their billing reconciliation to
match, they have to remember to send a copy of these emails WITHOUT the
attachments to the billing personnel who runs a reconciliation procedure to
match emails sent to customers against a database. If the user forgets to
send the email (they reply with different addressees so the attachments are
not sent), then it causes a reconciliation check, an email has to be sent to
the user asking for a copy of the email, the user has to send it and someone
tracks that it's received. My intent: after the user sends the email to
their customer, the rules wizard would automatically move the sent email
(based on words in the subject) to a folder, then the sub procedure would run
sending a reply to the appropriate billing people.

My code:

CODE IS IN “THISOUTLOOK SESSION”

Option Explicit
Dim WithEvents ReplyToItItems As Items

Private Sub Application_Startup()
Dim ns As Outlook.NameSpace

Set ns = Application.GetNamespace("MAPI")
Set ReplyToItItems = ns.Folders.Item("Personal
Folders").Folders.Item("test").Items

End Sub


Sub ReplyToItItems_ItemAdd(ByVal Item As Object)
' when a new item is added to "test folder" it is processed

Dim myReply As MailItem

Set myReply = Item.Reply
With myReply
.To = "
.Send
End With

End Sub

Private Sub application_quit()
Dim ns As Outlook.NameSpace
Set ReplyToItItems = Nothing
Set ns = Nothing
End Sub

=======

"Alan Moseley" wrote:

If your script is written within Outlook VBA then it should be possible to
write your code so that the warnings do not appear. Do you have any lines of
code similar to:-

Set objOutlook = New Outlook.Application
or
Set objOutlook = CreateObject("Outlook.Application")

If so then try changing this to:-

Set objOutlook=Outlook

If you then create further objects from this, such as:-

Set objNamespace = Outlook.GetNameSpace("MAPI")
Set objContacts = objNamespace.GetDefaultFolder(olFolderContacts).It ems

and so on, you will prevent the security warning from being shown as
'Outlook' is an in-built object that picks up a reference to the currently
running Outlook application.

If you need any further assistance then post your code and I will see what
needs changing.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I went through the steps you outlined multiple times, and there's no "run a
script" rule. I wonder if my company "turned off" this option?

I was hoping to use this as the VBA procedure I wrote results in the Outlook
Security Warning and is useless because of the warnings (my user would have
to click 'yes' 400+ times a month). I thought by using the RunAScript rule
it may prevent the warnings.

Thanks for responding.



"Alan Moseley" wrote:

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this option
when I go into rules, and I would really like to use it.

Any suggestions?

Thanks, in advance, for your help.

  #7  
Old July 7th 09, 09:27 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default STILL IS NOT AVAILABLE... Run A Script not listed in rules wizard

Did you check your security state yet? If it says "administrator
controlled," that means that the Exchange administrator is controlling
security and, unless they loosen it for you, you won't be able to run VBA
code without security prompts.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Sue Mosher [MVP]" wrote in message
...
Are you trying to create a rule for outgoing messages? The "run a script"
action is available only for incoming messages.

If you're getting security prompts with normal Outlook VBA code, using the
"run a script" rule isn't necessarily going to get around that. Maybe your
VBA code simply isn't constructed properly to derive all objects from the
intrinsic Application object. You might also want to tell us the security
state shown on the Help | About Microsoft Outlook dialog.

"laavista" wrote in message
...
I went through the steps you outlined multiple times, and there's no "run
a
script" rule. I wonder if my company "turned off" this option?

I was hoping to use this as the VBA procedure I wrote results in the
Outlook
Security Warning and is useless because of the warnings (my user would
have
to click 'yes' 400+ times a month). I thought by using the RunAScript
rule
it may prevent the warnings.

"Alan Moseley" wrote:

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check
it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.



"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it
shows
examples of using the rules wizard "run a script". I do not see this
option
when I go into rules, and I would really like to use it.





  #8  
Old July 8th 09, 08:49 AM posted to microsoft.public.outlook.program_vba
Alan Moseley
external usenet poster
 
Posts: 61
Default STILL IS NOT AVAILABLE... Run A Script not listed in rules wiz

Your code works perfectly on my stand-alone Outlook. I fear therefore that,
as Ms Mosher has already suggested, that the Outlook security has been
tightened up by your administrators.

Do you have to email this reply to the billing people? If you are running
Exchange server, could the email be copied to a public folder perhaps? This
shouldn't trigger the security prompts. Your code could be easily modified
to do this. Failing that, if you have Visual Studio, could you convert this
code to run via an Outlook Addin?

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

Alan, you do not know how much I appreciate you looking at my code to see if
the security warnings can be eliminated. I REALLY need to get this working
and have spent hours (and hours) trying things, researching, and trying more
things, with no luck. THANK YOU.

The reason I need this-- I have several users who send 400+ emails a month
to customers with attachments. In order for their billing reconciliation to
match, they have to remember to send a copy of these emails WITHOUT the
attachments to the billing personnel who runs a reconciliation procedure to
match emails sent to customers against a database. If the user forgets to
send the email (they reply with different addressees so the attachments are
not sent), then it causes a reconciliation check, an email has to be sent to
the user asking for a copy of the email, the user has to send it and someone
tracks that it's received. My intent: after the user sends the email to
their customer, the rules wizard would automatically move the sent email
(based on words in the subject) to a folder, then the sub procedure would run
sending a reply to the appropriate billing people.

My code:

CODE IS IN “THISOUTLOOK SESSION”

Option Explicit
Dim WithEvents ReplyToItItems As Items

Private Sub Application_Startup()
Dim ns As Outlook.NameSpace

Set ns = Application.GetNamespace("MAPI")
Set ReplyToItItems = ns.Folders.Item("Personal
Folders").Folders.Item("test").Items

End Sub


Sub ReplyToItItems_ItemAdd(ByVal Item As Object)
' when a new item is added to "test folder" it is processed

Dim myReply As MailItem

Set myReply = Item.Reply
With myReply
.To = "
.Send
End With

End Sub

Private Sub application_quit()
Dim ns As Outlook.NameSpace
Set ReplyToItItems = Nothing
Set ns = Nothing
End Sub

=======

"Alan Moseley" wrote:

If your script is written within Outlook VBA then it should be possible to
write your code so that the warnings do not appear. Do you have any lines of
code similar to:-

Set objOutlook = New Outlook.Application
or
Set objOutlook = CreateObject("Outlook.Application")

If so then try changing this to:-

Set objOutlook=Outlook

If you then create further objects from this, such as:-

Set objNamespace = Outlook.GetNameSpace("MAPI")
Set objContacts = objNamespace.GetDefaultFolder(olFolderContacts).It ems

and so on, you will prevent the security warning from being shown as
'Outlook' is an in-built object that picks up a reference to the currently
running Outlook application.

If you need any further assistance then post your code and I will see what
needs changing.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I went through the steps you outlined multiple times, and there's no "run a
script" rule. I wonder if my company "turned off" this option?

I was hoping to use this as the VBA procedure I wrote results in the Outlook
Security Warning and is useless because of the warnings (my user would have
to click 'yes' 400+ times a month). I thought by using the RunAScript rule
it may prevent the warnings.

Thanks for responding.



"Alan Moseley" wrote:

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this option
when I go into rules, and I would really like to use it.

Any suggestions?

Thanks, in advance, for your help.

  #9  
Old July 8th 09, 07:45 PM posted to microsoft.public.outlook.program_vba
laavista
external usenet poster
 
Posts: 15
Default STILL IS NOT AVAILABLE... Run A Script not listed in rules wiz

You might have an idea-- to copy it to a public folder. I would have to
figure out how to copy it without the attachments, though. (I'm VERY new to
Outlook VBA). I'll see if I can figure out how to do that.

Alan, THANK YOU, for taking the time to look at my code. It really helped.
I thought perhaps that I coded something incorrectly. REALLY appreciate it.

"Alan Moseley" wrote:

Your code works perfectly on my stand-alone Outlook. I fear therefore that,
as Ms Mosher has already suggested, that the Outlook security has been
tightened up by your administrators.

Do you have to email this reply to the billing people? If you are running
Exchange server, could the email be copied to a public folder perhaps? This
shouldn't trigger the security prompts. Your code could be easily modified
to do this. Failing that, if you have Visual Studio, could you convert this
code to run via an Outlook Addin?

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

Alan, you do not know how much I appreciate you looking at my code to see if
the security warnings can be eliminated. I REALLY need to get this working
and have spent hours (and hours) trying things, researching, and trying more
things, with no luck. THANK YOU.

The reason I need this-- I have several users who send 400+ emails a month
to customers with attachments. In order for their billing reconciliation to
match, they have to remember to send a copy of these emails WITHOUT the
attachments to the billing personnel who runs a reconciliation procedure to
match emails sent to customers against a database. If the user forgets to
send the email (they reply with different addressees so the attachments are
not sent), then it causes a reconciliation check, an email has to be sent to
the user asking for a copy of the email, the user has to send it and someone
tracks that it's received. My intent: after the user sends the email to
their customer, the rules wizard would automatically move the sent email
(based on words in the subject) to a folder, then the sub procedure would run
sending a reply to the appropriate billing people.

My code:

CODE IS IN “THISOUTLOOK SESSION”

Option Explicit
Dim WithEvents ReplyToItItems As Items

Private Sub Application_Startup()
Dim ns As Outlook.NameSpace

Set ns = Application.GetNamespace("MAPI")
Set ReplyToItItems = ns.Folders.Item("Personal
Folders").Folders.Item("test").Items

End Sub


Sub ReplyToItItems_ItemAdd(ByVal Item As Object)
' when a new item is added to "test folder" it is processed

Dim myReply As MailItem

Set myReply = Item.Reply
With myReply
.To = "
.Send
End With

End Sub

Private Sub application_quit()
Dim ns As Outlook.NameSpace
Set ReplyToItItems = Nothing
Set ns = Nothing
End Sub

=======

"Alan Moseley" wrote:

If your script is written within Outlook VBA then it should be possible to
write your code so that the warnings do not appear. Do you have any lines of
code similar to:-

Set objOutlook = New Outlook.Application
or
Set objOutlook = CreateObject("Outlook.Application")

If so then try changing this to:-

Set objOutlook=Outlook

If you then create further objects from this, such as:-

Set objNamespace = Outlook.GetNameSpace("MAPI")
Set objContacts = objNamespace.GetDefaultFolder(olFolderContacts).It ems

and so on, you will prevent the security warning from being shown as
'Outlook' is an in-built object that picks up a reference to the currently
running Outlook application.

If you need any further assistance then post your code and I will see what
needs changing.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I went through the steps you outlined multiple times, and there's no "run a
script" rule. I wonder if my company "turned off" this option?

I was hoping to use this as the VBA procedure I wrote results in the Outlook
Security Warning and is useless because of the warnings (my user would have
to click 'yes' 400+ times a month). I thought by using the RunAScript rule
it may prevent the warnings.

Thanks for responding.



"Alan Moseley" wrote:

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this option
when I go into rules, and I would really like to use it.

Any suggestions?

Thanks, in advance, for your help.

  #10  
Old July 9th 09, 10:04 AM posted to microsoft.public.outlook.program_vba
Alan Moseley
external usenet poster
 
Posts: 61
Default STILL IS NOT AVAILABLE... Run A Script not listed in rules wiz

Does this help?

Public Sub SaveACopy(objMailItem As MailItem)
Dim objMailCopy As MailItem
Dim objNamespace As NameSpace
Dim objPublicFolder As MAPIFolder
Dim objAttachment As Attachment

Set objMailCopy = objMailItem.Copy
Set objNamespace = Outlook.GetNamespace("MAPI")
Set objPublicFolder = objNamespace.Folders("Public Folders")
Set objPublicFolder = objPublicFolder.Folders("All Public Folders")
Set objPublicFolder = objPublicFolder.Folders("Insert Your Folder Name")

With objMailCopy
If .Attachments.Count 0 Then
For Each objAttachment In .Attachments
objAttachment.Delete
Next
End If
objMailCopy.Save
objMailCopy.Move objPublicFolder
End With
Set objMailCopy = Nothing
Set objPublicFolder = Nothing
Set objNamespace = Nothing
End Sub
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

You might have an idea-- to copy it to a public folder. I would have to
figure out how to copy it without the attachments, though. (I'm VERY new to
Outlook VBA). I'll see if I can figure out how to do that.

Alan, THANK YOU, for taking the time to look at my code. It really helped.
I thought perhaps that I coded something incorrectly. REALLY appreciate it.

"Alan Moseley" wrote:

Your code works perfectly on my stand-alone Outlook. I fear therefore that,
as Ms Mosher has already suggested, that the Outlook security has been
tightened up by your administrators.

Do you have to email this reply to the billing people? If you are running
Exchange server, could the email be copied to a public folder perhaps? This
shouldn't trigger the security prompts. Your code could be easily modified
to do this. Failing that, if you have Visual Studio, could you convert this
code to run via an Outlook Addin?

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

Alan, you do not know how much I appreciate you looking at my code to see if
the security warnings can be eliminated. I REALLY need to get this working
and have spent hours (and hours) trying things, researching, and trying more
things, with no luck. THANK YOU.

The reason I need this-- I have several users who send 400+ emails a month
to customers with attachments. In order for their billing reconciliation to
match, they have to remember to send a copy of these emails WITHOUT the
attachments to the billing personnel who runs a reconciliation procedure to
match emails sent to customers against a database. If the user forgets to
send the email (they reply with different addressees so the attachments are
not sent), then it causes a reconciliation check, an email has to be sent to
the user asking for a copy of the email, the user has to send it and someone
tracks that it's received. My intent: after the user sends the email to
their customer, the rules wizard would automatically move the sent email
(based on words in the subject) to a folder, then the sub procedure would run
sending a reply to the appropriate billing people.

My code:

CODE IS IN “THISOUTLOOK SESSION”

Option Explicit
Dim WithEvents ReplyToItItems As Items

Private Sub Application_Startup()
Dim ns As Outlook.NameSpace

Set ns = Application.GetNamespace("MAPI")
Set ReplyToItItems = ns.Folders.Item("Personal
Folders").Folders.Item("test").Items

End Sub


Sub ReplyToItItems_ItemAdd(ByVal Item As Object)
' when a new item is added to "test folder" it is processed

Dim myReply As MailItem

Set myReply = Item.Reply
With myReply
.To = "
.Send
End With

End Sub

Private Sub application_quit()
Dim ns As Outlook.NameSpace
Set ReplyToItItems = Nothing
Set ns = Nothing
End Sub

=======

"Alan Moseley" wrote:

If your script is written within Outlook VBA then it should be possible to
write your code so that the warnings do not appear. Do you have any lines of
code similar to:-

Set objOutlook = New Outlook.Application
or
Set objOutlook = CreateObject("Outlook.Application")

If so then try changing this to:-

Set objOutlook=Outlook

If you then create further objects from this, such as:-

Set objNamespace = Outlook.GetNameSpace("MAPI")
Set objContacts = objNamespace.GetDefaultFolder(olFolderContacts).It ems

and so on, you will prevent the security warning from being shown as
'Outlook' is an in-built object that picks up a reference to the currently
running Outlook application.

If you need any further assistance then post your code and I will see what
needs changing.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I went through the steps you outlined multiple times, and there's no "run a
script" rule. I wonder if my company "turned off" this option?

I was hoping to use this as the VBA procedure I wrote results in the Outlook
Security Warning and is useless because of the warnings (my user would have
to click 'yes' 400+ times a month). I thought by using the RunAScript rule
it may prevent the warnings.

Thanks for responding.



"Alan Moseley" wrote:

In Rules and Alerts click New Rule
Click 'Start From A Blank Rule' and choose a Step 1 option. Click Next
Select one or more conditions and click 'Next'
Under Select Action you should see an option for 'Run A Script', check it
and click on the 'a script' hyperlink in the bottom window.
Choose the script that you wish to run.
Continue the remainder of the wizard.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"laavista" wrote:

I'm using Outlook 2003. I purchased an Outlook VBA book, and it shows
examples of using the rules wizard "run a script". I do not see this option
when I go into rules, and I would really like to use it.

Any suggestions?

Thanks, in advance, for your help.

 




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
Rules Wizard Script Henry Stockbridge Outlook and VBA 2 August 29th 08 08:01 PM
"Run a Script" does not appear as an Action in the Rules Wizard Bob Miller Outlook - General Queries 1 November 4th 07 10:19 PM
Fax numbers no longer listed in send fax wizard addresses. Brian Outlook - Using Contacts 8 July 30th 07 03:44 AM
Help Running a script in Rules Wizard to save attachments Murphybp2 Outlook and VBA 1 May 1st 07 10:04 PM
Custom Rule or Script for Rules Wizard Rick Outlook and VBA 0 April 13th 07 09:10 PM


All times are GMT +1. The time now is 11:20 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.