This isn’t new. I found it linked from Scott Hanselman’s blog. Even though I didn’t discover it, it’s still pretty cool if you ever plan to post code to your blog, or include it in any other HTML document. Check out CopySourceAsHTML. It is a VS.NET add-in that copied selected text and formats it in HTML to look as it does in VS. Here is a sample.
12 Class HelloClass
13 ‘ Private Variables
14 Private _Who As String
15
16 ‘ Public Variables
17 Public Property Who() As String
18 Get
19 Return _Who
20 End Get
21 Set(ByVal Value As String)
22 _Who = Value
23 End Set
24 End Property
25
26 ‘ Public Methods
27 Public Function SayHello() As String
28 Return SayHello(Me.Who)
29 End Function
30
31 Public Function SayHello(ByVal Name As String) As String
32 Return String.Format(“Hello, {0}”, Name)
33 End Function
34 End Class