I cannot see my VBA macro in 'run a script' selection box

前端 未结 2 450
梦谈多话
梦谈多话 2020-12-08 22:58

I copied the following code in my oulook VBE, from one of the VBA communities and amended it as per my need. I can run it using F5 and F8. Now I would like to run this macro

相关标签:
2条回答
  • 2020-12-08 23:34

    I had the same issue today on a similar script after Office was upgraded to Version 1803 (Build 9126.2282). Removing the "Pubic" keyword from the sub did the trick. Not sure why, since has been working the other way for years.

    I also had to re-add the reg key that had disappeared - EnableUnsafeClientMailRules.

    0 讨论(0)
  • 2020-12-08 23:51

    To be recognized as proper script macro for the Rule Wizard, the macro has to have the expected parameter:

    Sub myRuleMacro(item as Outlook.MailItem)
    

    MSDN article (still valid for Outlook 2007/2010/2013/2016)

    Related article

    Article about enabling run-a-script rules otherwise disabled due to security reasons
    (registry key EnableUnsafeClientMailRules).

    0 讨论(0)
提交回复
热议问题