Results 1 to 16 of 16

Thread: Paste VBCode

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Paste VBCode

    Add-In: Paste HIGHLIGHT-tagged code

    Title: Paste VBCode

    Description: As you may be aware when you try to copy and then paste VB code which has been displayed in the forums using [highlight=VB] tags, the result is a single run-on line. A partial solution to that problem is to paste the code into WordPad (not NotePad) and then copy again from there, but while that gives separate lines, all indentation is lost. This Add-In provides a complete solution. After copying the highlight-tagged code you want to use, all you need to do is the press the "paste" button that will have been added to your IDE toolbars and the code will be pasted into an open code window. The Add-in uses Word (which must be on your PC) in the background to remove the numbering while maintaining line integrity and indenting. Read the HowTo.txt file included in the zip for creation and usage instructions.

    For similar code in a regular application see this.

    Feature list:
    As described above

    Known Problems:
    None

    Screen-shots: The following shows the button added by the Add-In



    Author Name: Martin Liss
    Attached Images Attached Images  
    Attached Files Attached Files

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Paste VBCode

    Dear Martin,
    In the Addins Manager, it showing as missing.How can solve this issue and one more thing ,What about using this for Vb.net

    Dana
    Please mark you thread resolved using the Thread Tools as shown

  3. #3
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Paste VBCode

    I tried to implement this code but after I typed AddToIni.AddToIni followed by Return I got this error.
    Attached Images Attached Images  
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Paste VBCode

    Quote Originally Posted by danasegarane
    Dear Martin,
    In the Addins Manager, it showing as missing.How can solve this issue and one more thing ,What about using this for Vb.net

    Dana
    If you compiled it and then did AddToIni that should not happen. In any case try that again with no other VB sessions open.

    As for .Net someone else will need to create a .Net version.

  5. #5

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Paste VBCode

    Quote Originally Posted by krtxmrtz
    I tried to implement this code but after I typed AddToIni.AddToIni followed by Return I got this error.
    I don't think that that is caused by my code but to fix it do

    VBA.Chr$(32)

  6. #6
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Paste VBCode

    I had to replace that line and many other occurrences of various string functions as new error messages were coming out. Finally I compiled the dll and got this message that a library was missing.





    Unfortunately I could not find version 10 of the library that it was looking for (I was testing in a W98 based computer), only version 8. But it was useless for I got a new error message.


    Attached Images Attached Images   
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  7. #7

  8. #8
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Paste VBCode

    As I said, I have version 8 of that dll. I have a version 11 on another (WinXP-based) computer but I assume it wouldn't work on the Win98-based computer.

    Now, the reason I'm testing the add-in in that old Win98 (laptop) computer is I have an English language version of Visual Studio in it. On the XP computer I have a Spanish version and I always run into trouble with third party add-ins due to local settings (you see, I really don't feel like racking my brain to long, maybe I'd rather manually delete numbered lines )
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  9. #9
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: Paste VBCode

    If I'm correct the [highlight] tag problem is not present in [code] tag.

    It would be very nice if you add a new feature in this addin - Copy-As-Colored-Code.
    This method will copy selected code from the IDE and wrap them inside [CODE] tags with color formatting. This will help posters as well.

    I think NoteMe's VBF extension has similar option. But it will be easier to use from IDE (and for non-Fx users).

    Code:
    Option Explicit
    
    Private Sub Form_Load()
        MsgBox "Hi !"
        ' blah blah
    End Sub
    PS. I have no problem with [highlight=vb] tag in Opera. Use Opera.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  10. #10
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Paste VBCode

    Quote Originally Posted by iPrank
    ...
    PS. I have no problem with [highlight=vb] tag in Opera. Use Opera.
    It's nice to know.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  11. #11
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Paste VBCode

    Quote Originally Posted by krtxmrtz
    It's nice to know.
    ...and now I've finally taken some time to install Opera and try pasting numbered code. Works very nicely.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  12. #12
    New Member
    Join Date
    Apr 2007
    Posts
    10

    Re: Paste VBCode

    I found an easier way. Notepad didn't work for me, it was still 1 big line with word wrap on or off.
    Just click to reply to message then copy the text from there. Then cancel the reply.

  13. #13
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Paste VBCode

    Quote Originally Posted by ed08724
    I found an easier way. Notepad didn't work for me, it was still 1 big line with word wrap on or off.
    Just click to reply to message then copy the text from there. Then cancel the reply.
    Yes, that's useful, specially because I use Firefox and always forget to use Opera when browsing the forums
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  14. #14
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: Paste VBCode

    [OffTopic]
    OperaView Extension for firefox : Open pages in Opera from Firefox and Mozilla context menus.
    [/OffTopic]
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  15. #15
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Paste VBCode

    Quote Originally Posted by iPrank
    [OffTopic]
    OperaView Extension for firefox : Open pages in Opera from Firefox and Mozilla context menus.
    [/OffTopic]
    So, as far as I undertand it, what this add-on does is just start Opera saving you the trouble of minimizing the Firefox window to make the Opera icon on the desktop visible so you can click on it. Kind of fancy thing though I wonder if it's really useful.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  16. #16
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,621

    Re: Paste VBCode

    Quote Originally Posted by krtxmrtz
    So, as far as I undertand it, what this add-on does is just start Opera saving you the trouble of minimizing the Firefox window to make the Opera icon on the desktop visible so you can click on it. Kind of fancy thing though I wonder if it's really useful.
    possibly. there's an IE add-in as well for firefox, and it actually uses the active x control to embed an IE session in a tab.
    My light show youtube page (it's made the news) www.youtube.com/@artnet2twinkly
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width