Outlook 2007 macro suddenly doesn’t work after reboot


Yesterday one of my questions got solved:

I setup a rule and tested the macro. Everything worked perfect.

I went to sleep, shutdown my computer. The next morning the rule won't start the script! What happend?! I already checked the macro security levels. I tried delete and create an new macro without luck...
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David LeeCommented:
Hi, Dennie.

Is the rule enabled?  Can you run the rule manually?
DennieAuthor Commented:

The rule is enabled, in the same rule I've set another action (mark as important) that does work. In my rule I have an action run script Project1.EditSubject (only 1 option selectable). When I go to tools->macro->macros there are no macros/scripts to run. Opening the visualbasic editor I see my EditSubject function. Any ideas?
David LeeCommented:
Because the macro is written to be fired by a rule it will not appear in the list of available macros when you click Tools > Macro > Macros.  Follow the instructions below to add the code to Outlook.  

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Edit the code as needed.  I included comment lines wherever something needs to or can change
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools > Trust Center
9.  Click Macro Security
10. Set Macro Security to "Warnings for all macros"
11. Click OK
12. Close Outlook
13. Start Outlook.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

Let me know what happens.
Private Sub Application_Startup()
    MsgBox "Macros are enabled"
End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

DennieAuthor Commented:
Everything seems to work your messagebox was shown.

I copied my own function in the vb editor from modules to Microsoft Office Outlook Objects ->thisOutlookSession. The rule works and script work now.

under tools ->macro-> macros is don't see any macros.

Is this ok?
David LeeCommented:
Yes.  The macro I posted would not show up in the list of available macros.
DennieAuthor Commented:
David LeeCommented:
You're welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.