Archive

Archive for the ‘Cheatsheet’ Category

How to edit or view Outlook email HTML source

April 1st, 2012

You might not know but more often than not, the email you compose and send out is in HTML format.

However, the email client software rarely allow you to edit the HTML source directly.
One recent use-case I have:

I want to put a yahoo emoticon into a Gmail composed email, not by attaching the image file, but a direct HTML img tag which shows the online image.

Obviously Gmail does not support coding HTML email.
There are many ways to do this, you could also sign up for some bulk email services that you can edit the HTML template, but that’s another story for sending more than one email.

So one easy way is to use Microsoft Outlook, edit the source and forward it to Gmail.

One thing is missing in some older Outlook versions though.
You cannot edit HTML source in Outlook directly.

Found the solution here: Outlook 2007: Edit your Messages HTML Source

Steps
1) Create a VB module with the following code
Create a module from Tools menu > Macros > Visual Basic Editor

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

2) Add ‘Edit HTML’ function to New message menu
Open a new message,
Click The Ribbon Customization Button
Select the “More Commands” Menu
Instead of “Popular Commands” Select the “Macros”

Select the new macro created named “Project1.EditHTML”
Select the EditHTML Macro
Click The “Add” Button, Customize the new button

3) Do the HTML editing!

Notepad will pop with the HTML source of the message
Do your editing
Close when done or if no changes performed

Credits to Udi!

Cheatsheet, Good To Know, Internet , ,

Unable to find a javac compiler. Perhaps JAVA_HOME does not point to the JDK

June 24th, 2011

This is sort of a Note to Self post.

In a very odd situation where you have set JAVA_HOME to the SDK, and it still complains that

Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to whatever

Solution is:
Copy JAVA_HOME\lib\tools.jar to JAVA_HOME\jre6\lib\ext

Credit: http://www.drftpd.org/forums/viewtopic.php?f=5&t=2978

Cheatsheet, Good To Know, Java, Software ,

How to view your Facebook profile as another user

May 18th, 2010

I always have this question in mind, what would my Facebook profile looks like when viewed by others? Or instead, a specific person? Like Mark Zuckerberg?

Of course, Mark Zuckerberg can view any Facebook profile he wants, even if you set privacy to Yourself Only. He’s the owner of Facebook!

Well, I found that testing the viewing of your profile can be done with using a specific user that you want.

For a start, let’s go through how you’d like to customize your profile settings :

From the menu on the top right, select Account -> Privacy Settings

Select Friends, Tags and Connections:

Double check your privacy settings, or if you’re not changing anything, look for the Preview My Profile… button :
Note that the hyperlink will go to : http://www.facebook.com/profile.php?viewas=100000686899395

Going to that page actually shows how your profile GENERALLY looks to most people on Facebook.

Because that user is a test user, so like anybody else which is not your friend, they will see very limited information.

Now say you want to know what will your profile display to a particular user?
Get the user profile id, or user name, works both ways, and replace the test user id (100000686899395) in : http://www.facebook.com/profile.php?viewas=100000686899395 with the user id you want to see.

For example, any one of this:
http://www.facebook.com/profile.php?viewas=markzuckerberg

http://www.facebook.com/profile.php?viewas=68310606562

Should I customize a bit and let him see MORE of me?
Guess not. 🙂

Cheatsheet, Good To Know, Internet , , ,