Run A Script not listed in rules wizard

Status
Not open for further replies.
L

laavista

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.
 
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.
 
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.
 
Re: 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

"laavista" <laavista> wrote in message

news:BD9B4898-5CA5-4993-B9C0-690935DEECF1@microsoft.com...
> 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.
 
RE: 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).Items

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.
 
RE: 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 = "whoever@abc.com"

> 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).Items

> 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.
 
Re: 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

"Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message

news:OS7F08r$JHA.5068@TK2MSFTNGP03.phx.gbl...
> 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" <laavista> wrote in message
> news:BD9B4898-5CA5-4993-B9C0-690935DEECF1@microsoft.com...
> >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.


>
 
RE: 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 = "whoever@abc.com"
> .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).Items
> > 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.
 
RE: 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 = "whoever@abc.com"
> > .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).Items
> > > > 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.
 
RE: 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 = "whoever@abc.com"
> > > .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).Items
> > > > > > 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.
 
Re: STILL IS NOT AVAILABLE... Run A Script not listed in rules wiz

Don't move the copy until you've finished deleting the attachments. Also,

deleting inside a For Each ... Next loop won't work because each deletion

resets the index. Use a down-counting loop instead:

With objMailCopy

count = .Attachments.Count

For i = count to 1 Step -1

Set objAttachment = .Attachments(i)

objAttachment.Delete

Next

End With

objMailCopy.Save

objMailCopy.Move objPublicFolder

Sue Mosher

"Alan Moseley" <AlanMoseley> wrote in message

news:7DCDAAD4-8793-4338-94A5-7B2723435556@microsoft.com...
> 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 = "whoever@abc.com"
> > > > .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).Items
> > > >> > > > 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.
 
RE: STILL IS NOT AVAILABLE... Run A Script not listed in rules wiz

Alan, this was VERY helpful!! Again, thank you so much. You have saved me

hours.

"Alan Moseley" wrote:


> 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 = "whoever@abc.com"
> > > > .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).Items
> > > > > > > > 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.
 
Re: STILL IS NOT AVAILABLE... Run A Script not listed in rules wiz

THANK YOU for your help with this!!! I appreciate your time!

"Sue Mosher [MVP]" wrote:


> Don't move the copy until you've finished deleting the attachments. Also,
> deleting inside a For Each ... Next loop won't work because each deletion
> resets the index. Use a down-counting loop instead:

> With objMailCopy
> count = .Attachments.Count
> For i = count to 1 Step -1
> Set objAttachment = .Attachments(i)
> objAttachment.Delete
> Next
> End With
> objMailCopy.Save
> objMailCopy.Move objPublicFolder

> > Sue Mosher
> > >

> "Alan Moseley" <AlanMoseley> wrote in message
> news:7DCDAAD4-8793-4338-94A5-7B2723435556@microsoft.com...
> > 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 = "whoever@abc.com"
> >> > > .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).Items
> >> > > >> > > > 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.


>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
J Outlook Rules VBA Run a Script - Multiple Rules Outlook VBA and Custom Forms 0
N Outlook 2021 'Run Script" Rules? Outlook VBA and Custom Forms 4
K Run a script rule to auto 'send again' on undeliverable emails? Outlook VBA and Custom Forms 1
G Save attachment run a script rule Outlook VBA and Custom Forms 0
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
Aussie Rules Run a Script on an Incoming Email OK and then the Email reverts Outlook VBA and Custom Forms 0
Y Outlook 2013 Run A Script Outlook VBA and Custom Forms 4
B Outlook rule run a Script doesn't work Outlook VBA and Custom Forms 1
B Wanting to run a script that will filter any body that has a russian link in it. Outlook VBA and Custom Forms 5
Bri the Tech Guy Registry Tweak to make "Run a Script" Action Available Outlook VBA and Custom Forms 2
Bri the Tech Guy Run Script rule not running for newly arriving messages Outlook VBA and Custom Forms 25
Vijay Error in rule- Run a script Using Outlook 1
Vijay Run script doesn't work in outlook Using Outlook 1
Diane Poremsky Run a Script Rule: Send a New Message when a Message Arrives Using Outlook 2
oliv- How to Run a Script IN AN ADDIN with Outlook's Rules and Alerts Outlook VBA and Custom Forms 2
L Run a Script Rule doesn't work Using Outlook 5
X Outlook script to run excel data Outlook VBA and Custom Forms 1
D RUN SCRIPT WHEN OUTLOOK IS CLOSE Outlook VBA and Custom Forms 1
L Cannot run script from rule Outlook VBA and Custom Forms 7
O modify vba to run it as script rule Outlook VBA and Custom Forms 8
P How many subs can run in one outlook VBA script Using Outlook 5
Xueying run a script in rules, first time succeed, failed afterwards Outlook VBA and Custom Forms 3
P Vba script including macro appears in rules but wont run Outlook VBA and Custom Forms 6
Jeff Rott Diane Question on "Use in a Run a Script Rule" Outlook VBA and Custom Forms 1
J Outlook 2007 Rules & VBA: How to run a script on a report message (ReportItem) Using Outlook 14
L Outlook 2007 Macro to Run a Script From a Contact Form Using Outlook 41
B The “run a script” function stopped unexpectedly in Outlook2007 Using Outlook 6
E run script fails suddenly Using Outlook 3
L Run script rule not exectued for first few mails Outlook VBA and Custom Forms 2
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
V Outlook macros no longer run until VB editor is opened Outlook VBA and Custom Forms 0
J Want to create a button on the nav bar (module add-in) to run code Outlook VBA and Custom Forms 2
T Outlook 2010 Errore run-time -2147417851 (80010105) Metodo delete ContactItem non riuscito Outlook VBA and Custom Forms 0
U Outlook 2019 VBA run-time error 424 Outlook VBA and Custom Forms 2
D Outlook 2013 Macros only run in VB editor, not in drop down or button Outlook VBA and Custom Forms 14
D We're sorry but outlook has run into an error Using Outlook 6
M White square in body of Outlook Messages (O2016 Version 2012 32bit Click To Run) Using Outlook 4
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1
A Apply Selected Emails to outlook rules and Run Rules Using Outlook 5
B VBScript doesn't run on Recipient Email Outlook VBA and Custom Forms 2
A Run-time error '430' on certain emails when trying to set "Outlook.mailitem" as "ActiveExplorer.Selection.Item" Outlook VBA and Custom Forms 2
S Outlook Custom Form Scripting only working when clicking on "Run this form" Outlook VBA and Custom Forms 2
O Outlook 2016 This rule will only run when you check your email in Outlook.... Using Outlook 4
B run scripts Using Outlook 1
A Run time error 424. object required in outlook 2013 Outlook VBA and Custom Forms 10
Dave A Run macro on existing appointment when it changes Outlook VBA and Custom Forms 1
O Run macro automatically at sending an email Using Outlook 11
P errors appear every time I run SCANPST Using Outlook 3
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
P Run Time Error 91 when linking contact to task in VBA Outlook VBA and Custom Forms 1

Similar threads

Back
Top