Microsoft Outlook - Editing Source of email - help please

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I know how to edit the source of email's with Outlook Express, but with plain Outlook XP I cannot figure out how to compose an html message and then edit the source to change things around in the email manually. The only thing I can figure out is how to view the source of it, however it will not let me save it. Can anyone enlighten me on how to do this, if you know?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

honestly, I have no idea what you mean. [???] Sounds like I should know how to
do this tho....guess I'll search along with you.
  • Borrow -A- Geek
  • Professor
  • Professor
  • User avatar
  • Posts: 763
  • Loc: Dallas/Ft Worth, Texas

Post 3+ Months Ago

yeah i been trying for an hour now with no luck. i can view the source no prob... but cant figure out how to edit ot evem "paste" the code into the source.. i tried puting the html into the ody nd it came acrossed as html code.. did not parse it however. any one else know?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

From all the research I did I do not think you can edit the source directly with Outlook, however, you can load html files into the message by going to

Insert->File

and then in that screen goto the bottom right where it says Insert... it should have a little down arrow there. Click that little arrow and change it to Insert as Text. Then simply find the html file you want to load (or one you made) and you can load it into the actual message.

As far as editing the source in the e-mail though like with Outlook Express, I cannot find a way, and do not think its possible.
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

I don't know how far you've gotten with this, but I stumbled upon something. It's
probably not what you want but I thought I'd share anyway...

Open the email you want to edit with a double-click so it's in its own window. You
can view the source, of course, with a right-click/View Source, but you should also
see the option to edit the message. Make any changes you want, then File/Save.

Click off of that email so another is selected, then go back to the one you just
edited so it refreshes. You should see the edit you made now.

Even if it's not your own email, you can still edit them. Pretty cool, I think, for
making notes or additions to people's messages right there in the original.

Hope that helps. :)
  • inthahousejamin
  • Born
  • Born
  • inthahousejamin
  • Posts: 1

Post 3+ Months Ago

The short answer is you can't.

Check the following resources...

Why you can't do it...
http://www.slipstick.com/mail1/html.htm

Some HTML'ish things you can do
http://office.microsoft.com/assistance/ ... 0553071033
  • anonymous2
  • Born
  • Born
  • anonymous2
  • Posts: 1

Post 3+ Months Ago

Of course you can. Use this macro:

Code: [ Select ]
Public Sub EditSource()
  Dim NewFileSystem As New Scripting.FileSystemObject
  Dim Shell As New WshShell
  Dim TempFileName As String
  Dim CurrentMailItem As MailItem
  Dim TempFile As TextStream
  
  
  Set CurrentMailItem = ActiveInspector.CurrentItem
  
  TempFileName = NewFileSystem.GetSpecialFolder(TemporaryFolder) & "\" & NewFileSystem.GetTempName
  Set TempFile = NewFileSystem.CreateTextFile(TempFileName, True, True)
  TempFile.Write CurrentMailItem.HTMLBody
  TempFile.Close
  Set TempFile = Nothing
  
  Shell.Run "notepad.exe """ & TempFileName & """", , True
  
  Set TempFile = NewFileSystem.OpenTextFile(TempFileName, ForReading, False, TristateTrue)
  CurrentMailItem.HTMLBody = TempFile.ReadAll
  TempFile.Close
  Set TempFile = Nothing
  
End Sub
  1. Public Sub EditSource()
  2.   Dim NewFileSystem As New Scripting.FileSystemObject
  3.   Dim Shell As New WshShell
  4.   Dim TempFileName As String
  5.   Dim CurrentMailItem As MailItem
  6.   Dim TempFile As TextStream
  7.   
  8.   
  9.   Set CurrentMailItem = ActiveInspector.CurrentItem
  10.   
  11.   TempFileName = NewFileSystem.GetSpecialFolder(TemporaryFolder) & "\" & NewFileSystem.GetTempName
  12.   Set TempFile = NewFileSystem.CreateTextFile(TempFileName, True, True)
  13.   TempFile.Write CurrentMailItem.HTMLBody
  14.   TempFile.Close
  15.   Set TempFile = Nothing
  16.   
  17.   Shell.Run "notepad.exe """ & TempFileName & """", , True
  18.   
  19.   Set TempFile = NewFileSystem.OpenTextFile(TempFileName, ForReading, False, TristateTrue)
  20.   CurrentMailItem.HTMLBody = TempFile.ReadAll
  21.   TempFile.Close
  22.   Set TempFile = Nothing
  23.   
  24. End Sub


(um, how you do this is
1. Under Outlook, press Alt+F11
2. Create a new Module (regular one, not a class one). Give it any name you want except EditSource (I called it EditSourceModule).
3. Paste the code in
4. under Tools -> References, add references to Microsoft Scripting Runtime and Windows Scripting Host Object Model
5. You can customize your mail editor toolbar to add a button for this macro, or while in a mail message press Alt+F8, select the macro and-- voila!
)
  • Ichinisan
  • Born
  • Born
  • Ichinisan
  • Posts: 1

Post 3+ Months Ago

anonymous2 wrote:
Of course you can. Use this macro:
Code: [ Select ]
Public Sub EditSource()
  
  Dim NewFileSystem As New Scripting.FileSystemObject
  Dim Shell As New WshShell
  Dim TempFileName As String
  Dim CurrentMailItem As MailItem
  Dim TempFile As TextStream
  
  Set CurrentMailItem = ActiveInspector.CurrentItem
  
  TempFileName = NewFileSystem.GetSpecialFolder(TemporaryFolder) & "\" & NewFileSystem.GetTempName
  Set TempFile = NewFileSystem.CreateTextFile(TempFileName, True, True)
  TempFile.Write CurrentMailItem.HTMLBody
  TempFile.Close
  Set TempFile = Nothing
  
  Shell.Run "notepad.exe """ & TempFileName & """", , True
  
  Set TempFile = NewFileSystem.OpenTextFile(TempFileName, ForReading, False, TristateTrue)
  CurrentMailItem.HTMLBody = TempFile.ReadAll
  TempFile.Close
  Set TempFile = Nothing
  
End Sub
  1. Public Sub EditSource()
  2.   
  3.   Dim NewFileSystem As New Scripting.FileSystemObject
  4.   Dim Shell As New WshShell
  5.   Dim TempFileName As String
  6.   Dim CurrentMailItem As MailItem
  7.   Dim TempFile As TextStream
  8.   
  9.   Set CurrentMailItem = ActiveInspector.CurrentItem
  10.   
  11.   TempFileName = NewFileSystem.GetSpecialFolder(TemporaryFolder) & "\" & NewFileSystem.GetTempName
  12.   Set TempFile = NewFileSystem.CreateTextFile(TempFileName, True, True)
  13.   TempFile.Write CurrentMailItem.HTMLBody
  14.   TempFile.Close
  15.   Set TempFile = Nothing
  16.   
  17.   Shell.Run "notepad.exe """ & TempFileName & """", , True
  18.   
  19.   Set TempFile = NewFileSystem.OpenTextFile(TempFileName, ForReading, False, TristateTrue)
  20.   CurrentMailItem.HTMLBody = TempFile.ReadAll
  21.   TempFile.Close
  22.   Set TempFile = Nothing
  23.   
  24. End Sub


How you do this is:

  • Under Outlook, press Alt+F11
  • Create a new Module (regular one, not a class one). Give it any name you want except EditSource (I called it EditSourceModule).
  • Paste the code in
  • under Tools -> References, add references to Microsoft Scripting Runtime and Windows Scripting Host Object Model
    You can customize your mail editor toolbar to add a button for this macro, or while in a mail message press Alt+F8, select the macro and-- voila!

You're awesome, Mr. Anonymous Person! I'm using Outlook 2003 (yes, still the '03 version) and somehow got this to work...but following your directions precisely didn't really work. I don't know anything about VBA, but there seemed to be some issue with the scope of the macro. I spent a long time messing with it and, somehow, it now works on my system. I now have a button on my Outlook toolbar to edit source while composing an email!

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 118 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.