Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi All, I have the following co

Status
Not open for further replies.

JohnAcc

Technical User
Aug 13, 2003
143
GB
Hi All,

I have the following code that gives me a msgbox with the person who's e-mailing me when i receive new mail. My problem is that i get a "you have new mail" after my own msgbox - is there any way to turn this off programmatically ?

Private Sub Application_NewMail()

Dim objItem As Outlook.MailItem
Set objItem = Application.GetNamespace ("MAPI").GetDefaultFolder(olFolderInbox).Items(1)
Response = MsgBox("You have new mail from " & objItem.SenderName, vbYesNoCancel)

If Repsonse = vbYes Then
MsgBox " Read Mail"
ElseIf Response = vbNo Then
MsgBox " Delete Mail"
Else
MsgBox " Cancel clicked"
End If


End Sub
 
John,

You don't necessarily need to turn this off programatically. You can do this directly in Outlook.

Go to Tools->Options in Outlook and press the Email Options... button. Then uncheck the "Display a notification message when a new email arrives" CheckBox, Click OK, Click OK again.

Hope this helps!


Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Hi Mike,

That's fine for my machine but i want to embed this code in all the machines in our building - therefore i want to be able to to it programatically
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top