
Outlook is so common rich application.. but it lacks of some simple and so much needed functions like:
- Edit message as new
- New message with already filled CC
- Reply to message with already filled CC
But real cool hackers never give up even if your best friend name is Bill.
Let's do it.
Pre-requests
- MS Outlook 2003/2007
- Patience (you've mentioned 'MS' in the point one, ain't so?)
Outlook and VBA macros
We start with the "Edit message as new" feature. "Edit as new" is a must-have when you want simply re-send message to somebody (not to forward, or to reply) or when you need to make some changes to message you'd sent earlier and re-send again. For sure, there is a standard function in Outlook for this: double click on some message -> click on the "Other Actions" item in toolbar -> choose "Edit message" in drop-down list. But we are lazy enough, we wish to do this with one click! So:
- Open Outlook
- Tools -> Macro -> Visual Basic Editor (or simply press ALT+F11)
- In the opened editor you'll see project structure on the left. Expand it: Project1 -> Microsoft Office Outlook Objects -> double click on node ThisOutlookSession.
- Paste the code below to the opened editor
Sub EditAsNew() Dim msg As Outlook.MailItem Set msg = Outlook.ActiveExplorer.Selection(1) If msg Is Nothing Then Exit Sub If Not TypeOf msg Is Outlook.MailItem Then Exit Sub Dim newMsg As Outlook.MailItem Set newMsg = Application.CreateItem(olMailItem) newMsg.To = msg.To newMsg.CC = msg.CC newMsg.BCC = msg.BCC newMsg.Subject = msg.Subject Call copyAttachments(msg, newMsg) newMsg.Body = msg.Body newMsg.Display Set msg = Nothing Set newMsg = Nothing End Sub Sub copyAttachments(objSourceItem, objTargetItem) Set fso = CreateObject("Scripting.FileSystemObject") Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder strPath = fldTemp.Path & "\" For Each objAtt In objSourceItem.Attachments strFile = strPath & objAtt.FileName objAtt.SaveAsFile strFile objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName fso.DeleteFile strFile Next Set fldTemp = Nothing Set fso = Nothing End Sub
- Save (CTRL+S) and close Visual Baic Editor
- Lets check! Select some message from 'Sent' folder and press ALT+F8
- You'll probably see Outlook message "Microsoft Office has identified a potential security concern"
- In opened window with list of available macroses choose our 'EditAsNew' and run it (button "Run")
- You should see chosen message ready to be edited and re-send
No fear! You can click "Enable Macros" and next time you'll call macros you won't get warning message. Until you restart Outlook. If you don't want to be bothered with this message you may turn off macros protection in Outlook (here regular security remark goes). To do it: Tools -> Macro -> Security -> Macro Security -> No Security checks for macros
Well, it works (at least - on my side). But life is too shot to accomplish items 5 and 7 each time you want to re-send message. That's why you'll read next chapter - Outlook tuning.
Outlook tuning
I know 3 methods to make world go around: keyboard, mouse and "Mu-u-u-m! Please, ...". It is possible to use shortcuts to launch macroses and I'm going to show how to do this in the next post.
But now, mouse-users, unite! We are going to customize Outlook toolbar- remove rarely used items and add our hand-made beauties.
- Right-click on standard toolbar

and choose "Customize"
- Click on any unwanted item from the standard toolbar and drag it somewhere out if toolbar - you'll see dagger - drop the item and it will disappear from the toolbar
- You've finished him/them? Let's add new button to launch "EditAsNew" macros. Recall (if needed) menu "Customize" (see step 1) -> tab Commands -> Categories: Macros -> Select macros "EditAsNew"

- Drag macros "EditAsNew" to the the toolbar and place it where you like. You'll get something like this:

- Do you like this informative caption for our new button? Me- not. But this is Outlook and everything is possible tonight. Let's rename caption: menu "Customize" (step 1 again) -> tab Commands -> Rearrange commands -> Choose a menu or toolbar to rearrange: Toolbar Standard -> select naughty "Project1.ThisOutlookSession.EditAsNew"

- Click to Modify Selection and change field "Name" in drop-down menu to whatever you like. As for me - straight "EditAsNew" is well enough.
The rest
As you might remember, at the beginning we were talking also about such features as
- New message with already filled CC
- Reply to message with already filled CC
- Reply to all with already filled CC
To add these features you need:
- VBA code for macroses (see below). Don't forget to modify the code - change e-mail from "prettysec@myrichoffice.com" to the correct one
- Run through the steps described above in a chapters "Outlook and VBA macros" and "Outlook tuning". NOTE: macroses should be pasted to the VBA editor, one after one.
Sub NewWithCc() Dim msg As Outlook.MailItem Set msg = Application.CreateItem(olMailItem) msg.CC = "prettysec@myrichoffice.com" msg.Display Set msg = Nothing End Sub
MS Outlook and "Reply to message with already filled CC" feature
Sub ReplyWithCc() Dim msg As Outlook.MailItem Set msg = Outlook.ActiveExplorer.Selection(1) If msg Is Nothing Then Exit Sub If Not TypeOf msg Is Outlook.MailItem Then Exit Sub Dim reply As Outlook.MailItem Set reply = msg.reply reply.Display reply.CC = "prettysec@myrichoffice.com" Set msg = Nothing Set reply = Nothing End Sub
MS Outlook and "Reply to all with already filled CC" feature
Sub ReplyToAllWithCc() Dim msg As Outlook.MailItem Set msg = Outlook.ActiveExplorer.Selection(1) If msg Is Nothing Then Exit Sub If Not TypeOf msg Is Outlook.MailItem Then Exit Sub Dim reply As Outlook.MailItem Set reply = msg.ReplyAll reply.Display reply.CC = msg.CC + "; prettysec@myrichoffice.com" Set msg = Nothing Set reply = Nothing End Sub
The last
My real Outlook standard toolbar screenshot. Check it out!

In EditAsNew, you copy the BCC from the original message to the new message, but you wouldn't actually have access to the BCC line. Otherwise, great post. You might also want to check the current selection to make sure something (a mailitem) is selected.
ReplyDeleteI've just checked issue with BCC- 'editAsNew' work correctly (at least on my Outlook 2007).
ReplyDeleteConcerning checking.. You are absolutely right- do check or love rake.
I've reformed!
Some days ago I was at the Inet and caught sight there - how do you fix a corrupt pst/ost. It interested me good design. I was shocked because of I had had a lot of corrupted emails on my PC. And the program recovered theirs for seconds and first of all I didn't pay the money.
ReplyDeleteWow!
ReplyDeleteHave you wrote a function "redirect", to be used instead of "forward"? (I've seen it in Eudora, and now I'm using it with an add on in Thuderbird)
It's very usefull when I receive a message, that is not for me and I would like to send it to the actual receiver, without formatting and leaving the same sender! It's ideal for info@xxxx.com messages, to be sent to the right person.