Incoming New Mail - Switching between two account

W

willy

Hey y'all...I've got a macro written to will automatically open up
attachments and print them out. My problem is that I have to have this macro
on an account where the person has two mailbox accounts (team mailbox),
example, will's e-mail, heather's e-mail. But I only want the code to fire
when new mail comes into will's e-mail.
This is the code to fire when a new mail comes in, but I only want it to
call the macro if the mail comes into the will's e-mail account.

Private Sub Application_NewMail()

Call checkAttachments()

End Sub

Thanks in advance for any help you can give me.

Will
 
E

Eric Legault [MVP - Outlook]

You can evaluate the value of the NameSpace.CurrentUser property to determine
the name of the user associated with the currently logged-on profile.
 
Top