none
Paste leading RTF spaces in Forum posts? RRS feed

  • Question

  • I'm try to develop a helper app to assist in the pasting and copying of code in the Forums.  How do you paste a RTF line with leading spaces.  When ever I paste a iine with leading spaces, the spaces are ignored.  Essentially, what I am asking is what modifications must be made to the RTF copied from the Visual Studio IDE in order to paste it to the Forums with the same formatting?  I've eliminated the double line spacing, but I haven't figured how to keep the spaces at the beginning of lines.
    Wednesday, January 6, 2010 3:18 PM

Answers

All replies

  • Yes, I started to do something like this for the "Perpetual Beta NNTP Bridge", which has similar formatting issues (at least in the NNTP-preferred plain text mode). Unfortunately, due to some careless housekeeping, I lost the code...

    But why are you using RTF? What I used was a standard Edit control (like NotePad), with a button to copy HTML-decorated text to the clipboard. For leading spaces I would just use  .
    David Wilkinson | Visual C++ MVP
    Wednesday, January 6, 2010 4:48 PM
  • But why are you using RTF? What I used was a standard Edit control (like NotePad), with a button to copy HTML-decorated text to the clipboard. For leading spaces I would just use  .

    I want to do this in code and I'd like to minimize the amount of code.  It's easy to do with Word interop, but it's difficult for me to do in code.  I haven't hit the right code for replacing spaces in the RTF with    I'm also trying to retain the colors, which I guess complicates things significantly.  Pasting code from the Visual Studio IDE  into  the Forums results in the loss of leading spaces and adds a line  to the spacing.  I can handle the extra line, but not the spaces.
    Wednesday, January 6, 2010 8:10 PM
  • I'm really an NNTP person, so I am not interested in colors and fonts (bold I can live with). And I am certainly not interested in the kind of mess that is frequently generated by the code editor.

    I have pretty good luck just pasting plain text code into the main forum editor (never use the code editor). But the NNTP bridge would screw up the formatting (removing leading spaces, removing things that looked like invalid tags), which is why I started experimenting with a helper.

    But I guess you want to paste into the code editor? Sorry, I can't help you with that, or with RTF.

    BTW, I think pasting text into the forums works much better with FireFox than with IE.


    David Wilkinson | Visual C++ MVP
    Wednesday, January 6, 2010 9:09 PM
  • Somehow I figured it out.  The current VB version of ForumsCodeFormatterVB is on my Skydrive at https://skydrive.live.com/?cid=a92d19bcc5711381#cid=A92D19BCC5711381&id=A92D19BCC5711381%21249
    • Marked as answer by JohnWein Sunday, May 13, 2012 5:50 AM
    Sunday, May 13, 2012 5:50 AM