How would I get the HTML from the clipboard?
Example: If I copy this thread, I do not want to see the text, I want to see the HTML.
Printable View
How would I get the HTML from the clipboard?
Example: If I copy this thread, I do not want to see the text, I want to see the HTML.
Something like this:
vb.net Code:
MsgBox(Clipboard.GetText())
that just displays the text, I want the HTML.
You have to view the pages source and copy that to the clip board
lol, I am aware of that, but that is not what I need.
Here is the source from that works with VB6: http://support.microsoft.com/kb/274326
Got it:vb.net Code:
MsgBox(Clipboard.GetText(TextDataFormat.Html))
Just got to write the code that will remove the header and tags.
edit2: And a pure HTML version. Not sure if this could be coded cleaner with vb.net, but it works:
vb.net Code:
If (Clipboard.ContainsText(TextDataFormat.Html)) Then Dim myString As String = Clipboard.GetText(TextDataFormat.Html) Dim StartOffset As Integer = InStr(myString, "<!--StartFragment-->") Dim EndOffset As Integer = InStr(myString, "<!--EndFragment-->") MsgBox(Mid(myString, StartOffset + 20, EndOffset - StartOffset - 20)) End If