0

I have two mailbox accounts in Outlook 2010.

  • Primary: Bob@something.com
  • Secondary: help@something.com

Every time I receive new mail to help@something.com I get the envelope of new mail.

I want to receive the envelope only for Bob@something.com

I cancelled the option to receive envelopes in Outlook.

I created a rule in Outlook 2010 under the account of Bob@something.com

I have the option to run a script but its empty.

I need to write VBA code that can do it:

If (mail was send to Bob@something.com) Then
    show Envelope
End If

I know that I can just add the folder of help@something.com instead of its account but it is not possible in my environment (cloud users).

I searched on the web and didn't find anything like this. For example, I did not find what code line can turn the envelope on in Windows.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
E235
  • 11,560
  • 24
  • 91
  • 141

1 Answers1

0

If you find displaying a message box is an acceptable alternative then the Run a Script format is described here Outlook's Rules and Alerts: Run a Script

From the rule you pass the new mail as "Item" like this:

Public Sub DisplayMessageBox(Item As Outlook.MailItem)

    ' You need not do anything with "Item" just use it as a trigger
    MsgBox "New mail in Bob@something.com"

    ' or you can enhance the message using "Item" properties
    MsgBox "New mail in Bob@something.com - Subject: " & Item.Subject

End Sub

You may also consider ItemAdd or NewMailEx which are a little more complex.

There is an ItemAdd example here How do I trigger a macro to run after a new mail is received in Outlook?

Community
  • 1
  • 1
niton
  • 8,771
  • 21
  • 32
  • 52