Check your Outlook Inbox for new messages . . .
Checks you Microsoft Outlook Inbox for new Mail Items.
Assumes
Need to set "References" to Microsoft Outlook.
Returns
The number of new messages
Rate Check your Outlook Inbox for new messages . . .
(8(8 Vote))
Dim objOutlook As Outlook.Application
Dim objMapiName As Outlook.NameSpace
Dim intCountUnRead As Integer
Private Sub Check_Mail_Click()
Set objOutlook = New Outlook.Application
Set objMapiName = objOutlook.GetNamespace("MAPI")
For I = 1 To objMapiName.GetDefaultFolder(olFolderInbox).UnReadItemCount
intCountUnRead = intCountUnRead + 1
Next
MsgBox "You have " & intCountUnRead & " new messages in your Inbox . .
", vbInformation + vbOKOnly, "New Messages . . ."
intCountUnRead = 0
Set objMapiName = Nothing
Set objOutlook = Nothing
End Sub
Check your Outlook Inbox for new messages . . . Comments
No comments yet — be the first to post one!
Post a Comment