Outlook 2007 only has all the macro tools greyed out except cancel

Kmeli
Kmeli used Ask the Experts™
on
I have VBA enabled and can open and create a module.  But when I try to run it comes up with run a macro window and does not find the module.  I have the design code window active
When I go to Macro in the tools the only choice I have is cancel.,...all else is greyed out
Thank you
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010

Commented:
Hello Kmeli,

Are you sure that you created at least one sub (as opposed to a function) and placed it in a regular module
(and not a class module, ThisOutlookSession, or the code module for a UserForm)?

Are you sure you are not using Option Private Module?

Are you sure you did not declare your sub as private?

Regards,

Patrick

Author

Commented:
module
(and not a class module, ThisOutlookSession, or the code module for a UserForm)?  It is under modules under Microsoft Outlook...not a class or under session

Are you sure you are not using Option Private Module?  Not a private module

Are you sure you did not declare your sub as private?  See below...not private
Sub RunBatfile(Item As Outlook.MailItem)
    Dim oShell As Object, sCmd As String
    Set oShell = CreateObject("WSCript.shell")
    sCmd = "C:\peoplenet\1.bat"
    '
End Sub


Under Tools Macro..the only option I have is cancel
Thank you
Top Expert 2010
Commented:
Subs that take arguments will not appear in the run macro dialog

Patrick
Success in ‘20 With a Profitable Pricing Strategy

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

Author

Commented:
Ok..it does not seem to work at all..trying to get it to run when a new email comes in.  It is not calling the batch file
 Tried to create a macro and that option is greyed out in Outlook so cannot do that
Any suggestions on what I am doing wrong?

Author

Commented:
This is for the other office programs..unfortunately not Outlook....but thank you
Top Expert 2010

Commented:
Kmeli,

Is this a case where you want the macro to run every time you receive a message?  If so, then you may want to
create a Rule.  Work steps are for Outlook 2003.

1) Leave your code as is

2) Select Tools|Rules and Alerts from the menu

3) Click New Rule on Rules and Alerts dialog (Email Rules tab)

4) Select STart from Bank Rule on Rules Wizard, select Check messages when they arrive, and click Next

5) Select any criteria as desired, and click Next

6) In Select Actions, select Run a Script.  Click on script in STep 2, and select your macro.  Click Next

7) Select exceptions as desired and click Next

8) Finish the wizard

Patrick
Top Expert 2010

Commented:
parasharabhishek,

With respect, the issue has nothing to do with macros being disabled :)

Patrick

Author

Commented:

Hi Matthew
I have the seurity settings correct..but the macros tools are greyed out except for cancel.  I think that is what is giving me an issue.   It is Outlook 2007 and I followed the steps using VBA...Outlook sees the VBA script it does not run ..even when I try to do it manually.  I cannot create a macro from tools pulldown.  I must be missing something ..just not sure what.  I have the VBA plugin etc
Thank you
Top Expert 2010

Commented:
Kmeli,

You did not answer my question: Is this a case where you want the macro to run every time you receive a message?

Patrick

Author

Commented:
Patrick
Yes..I want it to run each time a message is received .  If the message has a certain subject line I need a command to start an FTP client to go and pick up and decrypt a file.  
Top Expert 2010

Commented:
Kmeli,

OK, then did you follow my directions above on how to use a Rule to launch a macro?

Patrick

Author

Commented:
Patrick
I  have done that..but that is not really the issue.  The macro does not launch ..I cannot create a macro ..so I think I am missing some functionality and cannot see how to add..ie if I cannot create a macro it appears that Outlook does not process the scripts.  the security settings for macros are correct...do not know why I cannot create a macro. The script is there just does not run
Thank you
Top Expert 2010

Commented:
Kmeli,

I suggest that you use the 'request attention' link to ask the Moderators to send an alert to additional Outlook
experts.

Patrick

Author

Commented:
Still did not resolve options being greyed out..but I resolved  so it works and the input helped

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial