
Welcome to QuickSteps Week! This week we'll be going over a new Outlook 2010 feature called QuickSteps and how we can simulate some of these features in Outlook 2003 using VBA.

Read previous QuickStep posts:
- QuickSteps Week, Part 1 – Move To Folder
- QuickSteps Week, Part 2 – Forward To Manager
- QuickSteps Week, Part 3 – Done
Each day we'll be going over a different built-in QuickStep, including how to add it to your Standard toolbar. Today we'll go over the Reply & Delete QuickStep.
Opens a reply to the selected message, and then deletes the original message.
This one is another simple QuickStep. Just reply to the currently selected or open item, then delete the original. Note that the original is deleted even if you cancel the reply (the macro isn't smart enough to figure that out).
Sub ReplyAndDelete()
On Error GoTo ErrorHandler
Dim currentObject As Object
Dim msg As Outlook.MailItem
Dim newMessage As Outlook.MailItem
' grab the currently selected or open item
Set currentObject = GetCurrentItem
' act on mailitems only
If TypeName(currentObject) <> "MailItem" Then
MsgBox "This code works on e-mail messages only.", vbInformation
GoTo ProgramExit
Else
Set msg = currentObject
End If
' create reply and display for editing
Set newMessage = msg.Reply
newMessage.Display
' delete original
With msg
.UnRead = False
.Delete
End With
ProgramExit:
Exit Sub
ErrorHandler:
MsgBox Err.Number & " - " & Err.Description
Resume ProgramExit
End Sub
Add To Toolbar
Taken from Create Outlook toolbar buttons using VBA. This will assign the above macro to a toolbar button on the Standard toolbar.
Sub AddReplyAndDeleteButton()
Call AddToolbarButton("Reply and Delete", "Reply to selected e-mail and delete original", _
"ReplyAndDelete", , 328, msoButtonIconAndCaption)
End Sub
Visit Utility Functions for use with Outlook 2003 VBA for a copy of the GetCurrentItem procedure.
Hi – finally found someone who can possibly assist with some repetitive tasks at our office that are embarassing when we make mistakes. If you can refer me to books, website information or even developers we might pay to assist I would really appreciate it.
Simple things like:
Putting today's date in the subject field of the email
Incrementing newsletter number in the subject field
Creating the next newsletter and saving it in drafts when the current one is sent
Placing a copy of an outlook template in a templates folder in the inbox as well as the default folder they are saved in
Thanks heaps
Feel free to contact me privately.