UserForm in script run from Outlook Rule

Posted by Asgeir S. Nilsen on Stack Overflow See other posts from Stack Overflow or by Asgeir S. Nilsen
Published on 2010-05-21T08:03:10Z Indexed on 2010/05/21 12:50 UTC
Read the original article Hit count: 333

Filed under:
|
|

Based on http://support.microsoft.com/kb/306108 I'd like to create a custom rule that shows a custom UserForm instead of the plain old MsgBox. What I wrote was this:

Dim alerts As CustomAlerts

Sub CustomMailMessageRule(Item As Outlook.MailItem)
   alerts.Messages.AddItem Item.Subject
   alerts.Show
End Sub

CustomAlerts is a UserForm containing a single ListBox.

Sadly my attempt does not work -- no window appears. What am I doing wrong?

© Stack Overflow or respective owner

Related posts about outlook-vba

Related posts about outlook-2007