none
Using the INSERT CODE BLOCK button RRS feed

  • Question

  • I post VBA code from Microsoft Office into forums. 

    1.   If I use the forum's INSERT CODE BLOCK button, the list of languages does not include VBA or VB, only VB.NET.  If I select VB.NET and press the PREVIEW button, the right-hand window displays the code as I see it in the Microsoft Office IDE; this means that the preview shows the code in a mono-spaced font, Courier (I think), which preserves line indentations.  When I then click the INSERT button to transfer the code to my post, the font changes to a proportionally-spaced font; line indentations are not preserved; worse, when the code is copied from the post back to the IDE editor in Microsoft Office, what was originally a 4-space indent has become a 1-space indent, making the code all over the place.

    2.   If I post VBA code directly from the IDE to the post (without using the INSERT CODE BLOCK button), a mono-spaced font is used, but more often than not, after submitting the post, the code is very small, possibly in 8 point Courier, which is too small to be readable.

    3.   If I use Microsoft Word to draft a post and use, say, an 11 point Courier font for the code and then copy from Word to the post, the larger font size is retained after submitting the post; but when the code is copied from the Forum to the Microsoft Office IDE, everything is in double-line spacing.

    SUGGESTIONS:

    1.   Could you please include the VBA and VB languages in the list of languages?

    2.   Could you please use a mono-spaced font for code blocks after the code is submitted (i.e. in the forum window)?

    3.   Could you please preserve line indentation?

     

    Wednesday, September 22, 2010 12:04 AM

All replies

  • The lack of control over font size and font name is time wasting and frustrating. 

    Code is now appearing in a very small font size after using the INSERT CODE BLOCK button. 

    As line indentation is not retained, I've been editing the code after it has been pasted into the forum to make it look reasonable.  I can't see myself doing that for long!

    Does anyone know if this will change in the future and, if so, when?

    Are there any help topics on this problem?

    I have already made suggestions about forum editing tools here:

    http://social.msdn.microsoft.com/Forums/en-US/suggest/thread/8b81160b-a7f0-4395-ad2e-d537040e9d51

     

    • Proposed as answer by Minasemekete Monday, October 11, 2010 9:05 AM
    • Unproposed as answer by Geoff_G Monday, October 11, 2010 8:42 PM
    Sunday, October 3, 2010 10:22 AM
  • At the time of writing, using the Insert Code Block button still produces unpredictable results with regard to font size.  Sometimes, code posted to the forum is in a reasonable, easily-read font size, but more often, the font is very small.  (Indidentally, if the small font results from a decision to avoid wrapping long code lines, then I think the disadvantages out-weigh the benefits.) 

    If code posted to the forum is copied and pasted into a Word document, Word uses the base style "HTML Preformatted1" (in a test I did today).  This style is colored (green, blue, black, etc.) according to the color of the code.  However, all code in the Word document is invisible.  The font's hidden property is *not* selected.  It seems odd, therefore, that the text should be invisible.  Does anyone have an explanation please?  (I know how to make it visible; I just want to know why it's invisible.)

    As requested in the previous post in this thread, would it be possible to have some editing tools in the forum so we can change font size? 

    Alternatively, could there be some explanation as to why the font size is sometimes reasonable and sometimes very small?  If I had an understanding of what causes the small font, I'd avoid whatever it is I'm doing (if anything) that causes it.  But I just cannot figure it out!  It seems (but I bet it's not) unpredictable.

    I don't think we should have to squint to read posted code.  Can we please have some progress on this issue?  Many thanks. 

     

    Sunday, January 9, 2011 1:03 PM