Outlook 2007: Edit your Messages HTML Source

A thing that can drive you crazy while using Outlook 2007 is the "Edit Source" feature missing.
If you are using outlook the way i do, you probably want your messages to be exactly as you think they should.

Please Read this:
if you are not familiar with VBA macro editing and this article is too much for you,
you can buy a ready made Outlook Addin that will give you this feature and much more, this Addin is only for Outlook 2010 (you might want to upgrade your outlook first..) you can find the addin here: Plimus Secure Web Site

Or Read more about it in this post

it will allow you to:

1. Edit new and received messages HTML Source
2. View new and received messages as plain text
3. View new  and received messages with your default browser
4. View new  and received messages with Word Editor
5. Add an exact copy of the message as word .doc or .rtf attached to it

HTML Editor For Outlook 2010
Edit HTML Source

A discount coupon is available for my blog readers, just send me an email and i'll reply it to you.

If you do want to try it yourself, Go ahead and continue:

In some cases (indeed special cases - but they exist) you want the ability to edit your HTML source of the message, so here is the way to do it:

first, Open your Outlook 2007 and launch the VB Editor (alt-F11)

open your Outlook VB Editor to add the HTML Edit Macro

Click the "Insert" Menu and select "Module" to add a new module,

add a module for the new HTML Edit Macro

And add the following code:

Sub EditHTML()
Dim mit As MailItem
Dim fname As String
Dim fcon As String
If Application.ActiveInspector.CurrentItem.Class <> olMail Then
MsgBox "The HTML Code cannot be edit for this item." & vbCrLf & "Only Mail Items are supported.", vbExclamation, "Edit HTML Error"
Exit Sub
End If
Set mit = Application.ActiveInspector.CurrentItem
fname = Environ$("temp") & "\temptxt.txt"
On Error Resume Next
Kill fname
Open fname For Binary As #1
Put #1, , mit.HTMLBody
Close #1
Shell "notepad.exe " & fname, vbMaximizedFocus
MsgBox "Click OK when Done and the saved HTML will be inserted to your message", vbOKOnly + vbInformation, "Edit HTML"
Open fname For Binary As #1
fcon = Space(LOF(1))
Get #1, , fcon
Close #1
mit.HTMLBody = fcon
End Sub

if you have problem with copy-paste issues, please download the zip file from the link below

Download the EditHTML Module

Close the VB Editor (And save)

Add the "Edit HTML" button to the New message window:
Open a new message,
Click The Ribbon Customization Button

Customize the new message ribbon

Select the "More Commands" Menu

Need to create Barcodes Cheaply? Try this software.

Instead of "Popular Commands" Select the "Macros"

Select The macros commands section

Select the new macro created named "Project1.EditHTML"

Select the EditHTML Macro

Click The "Add" Button, Customize the new button:

Customize the new button

and Click the "OK" button

Now, you have a new icon at the ribbon (for any new message windows)

The new EditHTML button - anchor icon

Just Click it while editing your message

How to use the new button

Now, your Notepad will pop with the HTML source of the message,
just change what ever you need and save the file (File menu-Save) and close the notepad.

you will see (after you close the notepad) that your outlook is waiting with a message box on it,

Click OK to finish the update

Just Click the OK button and the new HTML code you edit will be imported to your message.

That's it,
Hope you will like to use it,

waiting for your comments,



  1. Thank you! I was going insane trying to figure this out.

  2. Thanks you, this is awesome. You just saved me hours of work.

  3. I was looking for this for hours.. Your are the man!!!!!

  4. Super, tahnk you a lot!!!

  5. That was awesome! You're great. Thanks for sharing your knowledge!

  6. I had the same problem that drove me crazy all day...
    Thanks a lot !!!

  7. A great workaround - thanks for sharing it!

  8. I found this to be extremely helpful - thanks for sharing!

  9. Thanks!
    You should probably add that you must enable Macros from Tools-Macros-Security in Outlook, unless you want the new addon to be disabled upon next boot.

  10. Great help, thanks a lot !!!

  11. thanks, you safe my life =)

  12. OMG Thank you SO MUCH! This saved my life today!

  13. You are great, worked like a charm! Thanks!

  14. Really Gr8 ! Thanks For sharing..

  15. Well done, my essay was a real success among tutors. I am so satisfied with your work.

  16. That was a neat job. My essay was done accurately, precisely and exactly to the point.

  17. thank you sir for your article. easy to understand and saved me quite a lot of time.

  18. Great!
    Works also fine on MS Outlook Version 14.0.5* (MS Office Pro 2010)
    THX a lot <3

  19. Great stuff!
    Works great in Outlook 2010 too.
    What a pitty that it was so hard to find it on the web...
    Let me add some keywords below which I tried for my own search - so others may find it faster.
    Cheers Jörg.

    outlook 2010 2007 html source code view edit change insert manipulate

  20. Great macro. Quick heads up, if you change the "notepad.exe " to your location of notepad++ you can use it instead of notepad. Which is much nicer for html.

  21. Excellent job! It took me some time to find it. I'm looking forward to reading more of your blog posts. Thanks a thousand times!
    Smee Afshin

  22. Thanks, love it already. So many features in Outlook 2010 and yet this one we have to add by hand, O the irony.

  23. Thanks - I couldn't believe that Outlook 2007 wouldn't let me edit the HTML directly so it was great to find your code!

  24. Fantastic! Thank-you so much :)

  25. out.

    that is some FINE work!

  26. You rock Udi, thanks!

  27. Thank you very much Udi. This code worked perfect in Outlook 2007.

    Note to other readers: you must enable Macros from Tools-Macros-Security in Outlook.

    Best regards from Managua, Nicaragua.


  28. Thank you very much dear.
    This saved a lot of time.
    Much appreciated.

    The Way It Works
    twiw.in | info@twiw.in

  29. Спасибо большое за помощь))