Hi,
I have obtained some code to check for new emails in Micorosft Outlook.
VB Code:
Dim olApp As Outlook.Application Set olApp = CreateObject("Outlook.Application") Dim olfolder As Outlook.MAPIFolder Set olfolder = olApp.GetNamespace("MAPI").GetDefaultFolder(6) If olfolder.UnReadItemCount > 0 Then If olfolder.UnReadItemCount = 1 Then lblMail = "You have " & olfolder.UnReadItemCount & " New Email" Image2.Visible = True Else lblMail = "You have " & olfolder.UnReadItemCount & " New Emails" Image2.Visible = True End If Else lblMail = "" Image2.Visible = False End If
What I want to know is how can I make the program test to see whether Outlook is open or not becuase it is really annoying if you don't have it open and the program is attempting to check for new emails every minute and is startiing outlook automatically and slowing down your system.
Thanks




Reply With Quote