Windows Live Writer

Live Writer syntax highlighting plug-in for WordPress.

About a year ago I wrote a small article how to use syntax highlighting in WordPress using Windows Live Writer.  Few months ago I discovered  Rich Hewlett’s plug-in for Windows Live Writer that works perfectly with WordPress blogs.  I’ve been using it since.

I’m very happy with this plug-in it works great, but it misses the WYSIWYG.  It would be nice to see the code exactly like it appears on the published page during creation of the post.  Also for XML you cannot see code at all.  But it looks great on the published page.

  <body>Rich, Thanks for the great plug-in.</body>

Rich also recently published a new version of his plug-in.  You can download it directly from this link.

I believe that you must have this plug-in if you host your blog on wordpress and publish snippets of code.

Windows Live Writer

Syntax highlighting in WordPress using Windows Live Writer

We always strive to make our code as readable as possible in our posts.  I’ve been searching for the perfect source code plug-in since I started blogging.  I finally found the style I like to present my code.  It looks like this:

        public void Foo()
            Console.WriteLine("Where's my code plug-in?");

You’ve probably seen this style many times before.  Until today I had no clue how I can present my code similar to this.  It just took a little bit of googling to find out that WordPress allows us to format our code like shown above.

Here’s the syntax we need to use:

[sourcecode language=’csharp’]

your code here


However, it doesn’t solves my problem completely.  I usually create my posts using Windows Live Writer (WLW) and if you try to type the code as above it is not going to look pretty.

So far I found this solution:

1. When pasting code into WLW change to Source view (Shift-F11).

2. Type following:

<pre>[sourcecode language=’csharp’]

— You code goes here.


3. Switch back to Edit view (F11).

Don’t be alarm that your code doesn’t look as expected in Windows Live Writer.  It’s going to look right in your WordPress blog.

kick it on

Windows Live Writer

Windows Live Writer Beta 2 Bug.

WLW In my previous post about WLW I mentioned about an ArgumentOutOfRangeException error I get when open existing posts from WordPress.   I was in touch with Joe Cheng from Microsoft.  He asked me to record HTTP activity when error happens and send the info to him.  Here is his reply.

Ahhhh shoot. This is a really bad bug caused by a simple programming error. This problem will occur if you have recent posts that contain pre, script, or style tags (only on WordPress). Unfortunately I don’t have a good workaround for you at this time. Really frustrating since the fix is less than a line of code.

I guess it’s a price of using Beta software.  I still use Windows Live Writer and very happy with it. I believe that WLW team did very good job with this product.  I also want to give some kudos to Joe Cheng, he was very fast to reply and eager to help me with this problem.

Windows Live Writer

Windows Live Writer Beta 2

This post was created with the recently released Windows Live Writer Beta 2.  It supports multiple providers out of the box, it works with WordPressWindows Live Spaces, and TypePad.  However, you can expand it by using Provider Customization API.  That exactly is what Scott Hanselman did for DasBlog.  Read Scott’s Windows Live Writer Beta 2 – DasBlog and the Customization API post for more details.



As I created this post, I had one problem when I tried to open my existing posts from WordPress.  I got ArgumentOutOfRangeException.