<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Copying HTML  on the clipboard</title><link>http://blogs.msdn.com/jmstall/archive/2007/01/21/html-clipboard.aspx</link><description>Setting plain text on the clipboard is easy. Call Clipboad.SetText("Hello!"), and it works great. But what if you want to set HTML? Tempting to think you just call Clipboard.SetText ("&amp;lt;b&amp;gt;Hello!&amp;lt;/b&amp;gt;", TextDataFormat.Html ). But that doesn't</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Interesting Finds: January 21, 2007</title><link>http://blogs.msdn.com/jmstall/archive/2007/01/21/html-clipboard.aspx#1503402</link><pubDate>Sun, 21 Jan 2007 18:20:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1503402</guid><dc:creator>Jason Haley</dc:creator><description /></item><item><title>re: Copying HTML  on the clipboard</title><link>http://blogs.msdn.com/jmstall/archive/2007/01/21/html-clipboard.aspx#1503443</link><pubDate>Sun, 21 Jan 2007 18:31:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1503443</guid><dc:creator>onovotny</dc:creator><description>&lt;p&gt;You might want to also take a look at the CopySourceAsHtml add-in for VS:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Among other features, it can let you include line-numbers and use a different font/size than the one you use for editing.&lt;/p&gt;
</description></item><item><title>re: Copying HTML  on the clipboard</title><link>http://blogs.msdn.com/jmstall/archive/2007/01/21/html-clipboard.aspx#1846348</link><pubDate>Fri, 09 Mar 2007 20:45:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1846348</guid><dc:creator>Craig</dc:creator><description>&lt;p&gt;Tried your code exactly and it doesn't work :( Using XP, C# 2.0. Bummer. I've been trying to copy to HTML to the clipboard all morning. I may have to throw in the towel and get rid of that functionality. Nice code though, wished it worked.&lt;/p&gt;</description></item><item><title>re: Copying HTML  on the clipboard</title><link>http://blogs.msdn.com/jmstall/archive/2007/01/21/html-clipboard.aspx#1847884</link><pubDate>Sat, 10 Mar 2007 00:50:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1847884</guid><dc:creator>jmstall</dc:creator><description>&lt;p&gt;Craig - where breaks? Does it just not paste? What application are you pasting into? Does it at least paste accurately into Word or Front-page?&lt;/p&gt;
</description></item><item><title>re: Copying HTML  on the clipboard</title><link>http://blogs.msdn.com/jmstall/archive/2007/01/21/html-clipboard.aspx#2087204</link><pubDate>Wed, 11 Apr 2007 18:02:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2087204</guid><dc:creator>Jeff Winchell</dc:creator><description>&lt;p&gt;You are correct about &amp;quot;Since the header spec wasn't very precise.&amp;quot;&lt;/p&gt;
&lt;p&gt;I read a header I manually put into the clipboard (by typing Ctrl-C in a browser window). I was able to replicate this HTML using the SetClipboard WinAPI function with considerable work. Then I started removing things to see when it broke.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;If I didn't put a line break between the last &amp;lt;/Body&amp;gt; and &amp;lt;/HTML&amp;gt; end tags, it didn't work. If I didn't put a line break right before &amp;quot;StartFragment&amp;quot; and also right before &amp;quot;EndFragment&amp;quot; (I mean the instances of those strings in the first 50 or so characters). Also, I didn't test how exact it wanted line break... I used ASCII 13 and 10 for my line breaks.&lt;/p&gt;
&lt;p&gt;This was true for my WinXP Pro SP2 machine (using MSFT Dynamix AX as the front end to the WinAPI code... I'll try C# shortly)&lt;/p&gt;
&lt;p&gt;There may be other caveats I haven't run into.&lt;/p&gt;
&lt;p&gt;In general though, this task was a huge PITA.&lt;/p&gt;
&lt;p&gt;I also can't believe MSFT thinks HTML is a custom format.&lt;/p&gt;</description></item><item><title>3 years!</title><link>http://blogs.msdn.com/jmstall/archive/2007/01/21/html-clipboard.aspx#5308431</link><pubDate>Sat, 06 Oct 2007 09:52:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5308431</guid><dc:creator>Mike Stall's .NET Debugging Blog</dc:creator><description>&lt;p&gt;I just noticed that my blog had birthday #3 (Sep 30th) . In tradition, some various stats... 384 posts.&lt;/p&gt;
</description></item></channel></rss>