Debugging an Outlook 2007 script fired by a rule

前端 未结 2 798
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 14:35

I\'m trying to debug an Outlook 2007 VBA script that\'s fired by a rule. I\'ve set a breakpoint in the script but it doesn\'t get hit.

The script is actually a

2条回答
  •  星月不相逢
    2020-12-03 15:10

    Any existing item can be used to test code that requires one.

    Sub passOpenItem()
        'first open an item
        codeRequiringItemParameter ActiveInspector.CurrentItem
    End Sub
    
    Sub passSeletion()
        'first select an item
        codeRequiringItemParameter ActiveExplorer.Selection(1)
    End Sub
    
    Sub codeRequiringItemParameter(itm As Object)
        Debug.Print "TypeName: " & TypeName(itm)
        Debug.Print "Class...: " & itm.Class
    End Sub
    

提交回复
热议问题