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,

Udi

34 comments:

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

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

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

    ReplyDelete
  4. Super, tahnk you a lot!!!

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

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

    ReplyDelete
  7. A great workaround - thanks for sharing it!

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

    ReplyDelete
  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.

    ReplyDelete
  10. Great help, thanks a lot !!!

    ReplyDelete
  11. thanks, you safe my life =)

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

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

    ReplyDelete
  14. Really Gr8 ! Thanks For sharing..

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

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

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

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

    ReplyDelete
  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.

    keywords:
    outlook 2010 2007 html source code view edit change insert manipulate

    ReplyDelete
  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.

    ReplyDelete
  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

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

    ReplyDelete
  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!

    ReplyDelete
  24. Fantastic! Thank-you so much :)

    ReplyDelete
  25. out.
    stand.
    ing.

    that is some FINE work!

    ReplyDelete
  26. You rock Udi, thanks!

    ReplyDelete
  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.

    Willy

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

    Cheers,
    Hatim
    The Way It Works
    twiw.in | info@twiw.in

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

    ReplyDelete