|
-
Aug 17th, 2009, 08:23 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Get HTML from the clipboard?
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.
Last edited by Zeratulsdomain; Aug 17th, 2009 at 08:56 PM.
-
Aug 17th, 2009, 08:24 PM
#2
Hyperactive Member
Re: Get HTML from the clipboard?
Something like this:
vb.net Code:
MsgBox(Clipboard.GetText())
I am still very new to VB.NET, so I have MANY questions
-
Aug 17th, 2009, 08:27 PM
#3
Thread Starter
Hyperactive Member
Re: Get HTML from the clipboard?
that just displays the text, I want the HTML.
-
Aug 17th, 2009, 08:28 PM
#4
Hyperactive Member
Re: Get HTML from the clipboard?
You have to view the pages source and copy that to the clip board
I am still very new to VB.NET, so I have MANY questions
-
Aug 17th, 2009, 08:30 PM
#5
Thread Starter
Hyperactive Member
Re: Get HTML from the clipboard?
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
-
Aug 17th, 2009, 08:56 PM
#6
Thread Starter
Hyperactive Member
Re: Get HTML from the clipboard?
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
Last edited by Zeratulsdomain; Aug 17th, 2009 at 09:15 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|