copying vbcode from posts
if you get annoyed at the line numbering in the vbcode boxes when copying to paste elsewhere
Sub Main()
Dim myarr() As String
myarr = Split(Clipboard.GetText, vbNewLine)
For i = UBound(myarr) To 0 Step -1
If IsNumeric(myarr(i)) Then myarr(i) = ""
Next
Clipboard.Clear
Clipboard.SetText Replace(Join(myarr, vbNewLine), vbLf & vbCr, "")
End Sub
make a project with the above code (no form needed) and compile
copy from the post
run program (nothing visible happens)
paste into whatever code window
[561 byte] By [
westconn1] at [2007-12-5 10:21:14]

# 2 Re: copying vbcode from posts
Moved to the CodeBank
You don't need to do any deleting or formatting.
If you want a piece of highlighted code, click the quote button. The post you are "quoting" will be displayed in plain text. Just copy the code and then cancel out of the quote.
Hack at 2007-12-6 10:40:10 >

# 3 Re: copying vbcode from posts
true.. but doing it that way you get stuck with place holders you need to remove, westconn1s way has none .. guess it depends on how lazy you are.. and I am lol
# 6 Re: copying vbcode from posts
Oh please, you don't copy those, you just copy what is in between them.
Hack at 2007-12-6 10:44:18 >

# 7 Re: copying vbcode from posts
Down to preference then, I prefer the code way, saves me clicking off the post too
# 9 Re: copying vbcode from posts
Actually it isn't mine, it's Marty's:
http://www.vbforums.com/showthread.php?t=458328
http://www.vbforums.com/showthread.php?t=458438
(I personally use the Quote & copy method)
# 10 Re: copying vbcode from posts
Nice and simple westconn1!
Just needed to add, dim i as...
# 12 Re: copying vbcode from posts
It's not as simple as that unfortunately - the current version of the forum software does not support our our old highlighting method, and there aren't options for how the current one works.
The current method is a decent replacement, even with this relatively minor issue. The development team had various issues to deal with here when we upgraded, and finding/implementing that highlighter was more than they were required to do (they could have just left us with Code tags). As they work on multiple sites (including about 30 forums) which have their own issues, something like this isn't at the top of their list.
There is work in progress to modify the highlighter to deal with the line numbers (and other minor issues such as colours), but as it not overly simple, and is being done by a moderator (thus voluntarily), it is not something which will happen immediately - but hopefully will be complete in the near future..