Running a custom script

Posted on 2006-04-10
Last Modified: 2010-04-08
I want to create a custom script to run using the rules wizard to do the following

Save the attachment on the file to a specific directory (Check if it has the attachment first, of course)
Run a small application, passing in the name of the attachment as a parameter

I've tried to use the MSDN help page, and it can see the script. It's just not running. Any ideas why would be gratefully received.
Question by:Ekaterin
    LVL 35

    Expert Comment

    You mean, the script is ready, but not running?

    Have you checked the macro security of Outlook? The default settings allowing only secure or signed macros to run

    Author Comment

    Yes, I've set the macro security to 'low', but even with this the script is not running. I've even just put in the standard script from MSDN, but no msgbox appears. I can get it to do almost any of the other options (play a sound, flag it, move it etc.) just not run the script.

    If anyone can manage what I want it to do (recap)

    1) save the attachment to a specific directory
    2) run an exe with the name of the attachment passed in as a parameter

    then you get the points. I don't actually need it to be done via script.
    LVL 35

    Expert Comment

    How have you triggered the script, by a rule?

    Can you send a link to the script or post it here, if not too long?

    Author Comment

    Screendump of rule can be found at

    Macro is

    Sub CustomMailMessageRule(Item As Outlook.MailItem)
       MsgBox "Mail message arrived: " & Item.Subject
    End Sub

    Author Comment

    Update - I've just put in a really simple macro

    public sub msg()
    msgbox "Hi there"
    end sub

    I tried to run it from tool > Macro > Macros and got the following error.

    The macros in this project are disabled. Please refer to the online help or documentation of the host application to determine how to enable macros.

    It could be that we are running Small Business Server here, and it may have disabled macros on there (if so, we have a real problem as my husband changed the admin password, and mistyped it - twice - the same way)

    Any ideas as to what is happening will be gratefully received.
    LVL 44

    Accepted Solution

    Hello Ekaterin,

    i assume the sequence was
    1. you opened outlook
    2. then went out to look for a script
    3. found a script
    4. realized the security was set to high
    5. put it lower but it still does not work
    6. you need to close outlook and reopen it for the new security settings to take hold
    7. then try your script again

    hope this helps a bit
    LVL 35

    Assisted Solution

    You server produced a timeout at the moment.

    Jepp, make, what bruintje said, restart Outlook, have a look again at the security settings if they are still set to low. If Outlook changed the settings back, there may be a AD-policy, which sets the Outlook security back to high.

    I'm not sure if SBS has a default policy for Outlook.

    You want to say, you have lost your Admin password for the SBS Server? No other Domain Admin?

    Author Comment

    Yes, we have lost (or rather my husband lost) our admin password for our SBS server, with no other domain admin.  Wonderful.
    To make it worse, we had mirrored discs, and we couldn't get a linix system to run on mirrored discs. We have now used ghost to create a single disk, and need to try the linix disc on that.  But that is for another day and, indeed, another question on EE.

    Much thanks to both Bembi and bruintje. As you were both really helpful, I'm sharing the points between you.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
    Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now