Feed Icon  


  • Bryant Likes
  • Send mail to the author(s) E-mail
  • twitter
  • View Bryant Likes's profile on LinkedIn
  • del.icio.us
Get Microsoft Silverlight
by clicking "Install Microsoft Silverlight" you accept the
Silverlight license agreement

Hosting By

Hot Topics


Open Source Projects



Clipboard Paste Live Writer Plugin

Posted in .NET | Live Writer at Thursday, August 17, 2006 11:55 AM Pacific Daylight Time

If you copy source as html (or have any html in the clipboard), hitting paste in Windows Live Writer pastes the text without the markup. So since there is an SDK and some great samples, I went ahead and wrote a simple plugin to paste the clipboard contents as html (in about 10 minutes).

public override DialogResult CreateContent(IWin32Window dialogOwner, ref string newContent)
            DialogResult result = DialogResult.OK;
            if (Clipboard.ContainsText() == true)
                newContent = Clipboard.GetText();
                result = MessageBox.Show(dialogOwner, "Copy your HTML to the clipboard.", "Paste as Html", MessageBoxButtons.OKCancel);
                if (result == DialogResult.OK && Clipboard.ContainsText() == true)
                    newContent = Clipboard.GetText();
            return result;

I've applied to join the CodePlex project so maybe my humble contribution will get added, but for now you can download it here.

Technorati Tags: -

Thursday, August 17, 2006 6:21:39 PM (Pacific Daylight Time, UTC-07:00)
Nice :)
I planned to do it, but if it si done :)

Sunday, August 27, 2006 12:06:05 PM (Pacific Daylight Time, UTC-07:00)
Nice! Can I keep it in Live Writer Plugins website so that other Live Writer users can use it ? Thanks!
Monday, August 28, 2006 5:14:01 AM (Pacific Daylight Time, UTC-07:00)
Monday, August 28, 2006 8:37:40 AM (Pacific Daylight Time, UTC-07:00)
Humble it may be, but also quite useful. The way Writer handles pastes from VS is one of the top complaints we get from MS developers. I'm glad to see you found a clever workaround to take some heat off of us ;-)

I hope you'll consider posting it to the Windows Live Writer plugin gallery.

Thursday, August 31, 2006 6:10:32 AM (Pacific Daylight Time, UTC-07:00)
Thanks Brain. Just what I needed. I do get some funky spaceing however as shown here:

It looks fine when posted into LW and in LW Preview, but when seen on the real site, it adds spaces. Any ideas? TIA!
Friday, September 1, 2006 3:33:47 AM (Pacific Daylight Time, UTC-07:00)
Thanks for your post on my blog. I am still having the same issue. Maybe it is because I am using CopyAsHtml 2.0? If you ever upgrade and see this issue yourself, please drop me a comment. Thanks again Bryant!
Comments are closed.