
outlook message recieved macro
I am trying to write a macro that will send a reply back to someone
that emails me when i haven't checked their mail with in 10 minutes of
getting it. This is what i have so far:
Public Sub test()
Dim oApp As Outlook.Application
Dim oCtl As Office.CommandBarControl
Dim oPop As Office.CommandBarPopup
Dim oCB As Office.CommandBar
Dim oNS As Outlook.NameSpace
Dim oItem As MailItem 'Object
Dim counter As Integer
Set oApp = CreateObject("Outlook.Application")
Set oNS = oApp.GetNamespace("MAPI")
On Error Resume Next
Set oItem = oApp.ActiveInspector.CurrentItem
Set counter = 0
If Application.ActiveExplorer.Selection.Count > 0 Then
Do
Set oItem =
Application.ActiveExplorer.Selection.Item(counter)
If oItem.UnRead 'and time reciev more then 10 minutes ago
Then
'Rpley here
End If
Set counter = counter + 1
Loop While counter <
Application.ActiveExplorer.Selection.Count
End If
End Sub
Can this be done?
Thanks
Billy