S
sasan sepahbodi
Hi every one,
i have a problem. My macro is working excellent, but just when vba editor
was opened one time!. Why taht?
Scenery:
Outlook 2003
Win 2003
_________________________________________
Private Sub Application_NewMail()
'MsgBox "NewMail"
Dim outlookNameSpace As Outlook.NameSpace
Dim inbox As Outlook.MAPIFolder
Dim items As Outlook.items
Dim mail As Outlook.MailItem
Set outlookNameSpace = Me.GetNamespace("MAPI")
Set inbox = outlookNameSpace.GetDefaultFolder(olFolderInbox)
Set items = inbox.items
items.Restrict ("[Unread] = true")
For Each mail In items
'MsgBox "For each NewMail"
Next
End Sub
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
mailCopy
'MsgBox "NewMailEx"
End Sub
TanX
Sani
i have a problem. My macro is working excellent, but just when vba editor
was opened one time!. Why taht?
Scenery:
Outlook 2003
Win 2003
_________________________________________
Private Sub Application_NewMail()
'MsgBox "NewMail"
Dim outlookNameSpace As Outlook.NameSpace
Dim inbox As Outlook.MAPIFolder
Dim items As Outlook.items
Dim mail As Outlook.MailItem
Set outlookNameSpace = Me.GetNamespace("MAPI")
Set inbox = outlookNameSpace.GetDefaultFolder(olFolderInbox)
Set items = inbox.items
items.Restrict ("[Unread] = true")
For Each mail In items
'MsgBox "For each NewMail"
Next
End Sub
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
mailCopy
'MsgBox "NewMailEx"
End Sub
TanX
Sani