Reply-and-delete function in Outlook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear sir,
I am a CEO of a software company (.net based CMS system Digimaker) and I
receive a lot of emails daily. After replying to a message I have to manually
delete it from my inbox. In other email clients they often have the function
"reply and delete" / (or maybe a "reply and archieve".

I would welcome a function like that and I would be willing to pay for some
programming hours if a macro could solve this.

Regards,
Robert Kristiansen
CEO
Digimaker
 
Hello Robert,

which OL version do you use? Do you need the solution for yourself only
or do you want to distribute it?

For yourself here is a little sample (built for OL2k without
warranties etc.), for distribution you should order an Add-In, which
can´t be done here for you.

A few limitations: Only e-mails will be handled, after you have clicked
the button, the original item will be deleted, even if you should decide
to cancel the reply.

<ThisOutlookSession>
Private WithEvents ReplyButton As Office.CommandBarButton

Private Sub Application_Startup()
Set ReplyButton = Application.ActiveExplorer.CommandBars.FindControl(,
354)
End Sub

Private Sub ReplyAndDeleteMail()
Dim obj As Object
Dim oMail As Outlook.MailItem
Dim oReply As Outlook.MailItem
Dim bVisible As Boolean

With Application
If TypeOf .ActiveWindow Is Outlook.Inspector Then
Set obj = .ActiveInspector.CurrentItem
bVisible = True
Else
Set obj = .ActiveExplorer.Selection(1)
End If
End With

If TypeOf obj Is Outlook.MailItem Then
Set oMail = obj
Set oReply = oMail.Reply
If bVisible Then
oMail.Close olDiscard
End If
oMail.Delete
Set oMail = Nothing
Set obj = Nothing
oReply.Display
End If
End Sub

Private Sub ReplyButton_Click(ByVal Ctrl As Office.CommandBarButton, _
CancelDefault As Boolean _
)
ReplyAndDeleteMail
CancelDefault = True
End Sub
</ThisOutlookSession>
 
Back
Top