user3494110
user3494110

Reputation: 427

No macros showing under rules

I made VBA code using alt + f11 in Outlook 365 which I would like to use in a rule.

I can see the macro on my ribbon however when I go to Rules and Alerts and create a rule, the script does not show in the dialogue box.

When you select "Run a script" as the action to take, I'm assuming that when you click on 'script' a list of available macros is supposed to show up. Mine has none.

I set the macro security settings accordingly but I still do not see it as available.

Upvotes: 0

Views: 1535

Answers (1)

niton
niton

Reputation: 9199

The first line has to look like this.

Sub name(itm as mailItem)

or

Sub name(itm as meetingItem)

"itm" is the mail or meeting that is being received.

Normally you would now remove everything in the code that tries to reference items already received and use the "itm" passed in the parameter.

For instance

Debug.Print itm.Subject

Upvotes: 1

Related Questions