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

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?
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.