Format text in MsgBox RRS feed

  • Question

  • How do I format text that is presented in message boxes. I have looked for what I know as escape characters, but like a lot of things maybe MS calls these something else. I want to for example add newlines and tabs. Changing font would be handy also, as would the ability to add images. If you can help on the fonts and images fine, but at the moment I really need to be able to add newlines and tabs.




    MsgBox "Here is some text /newline /tab Here is the next line of text indented."


    This does not work obviously, but how would I achieve my intention?

    Thursday, March 29, 2007 4:50 AM


All replies

  • Hi une

    That's easy.

    vbNewLine and vbCrlf are the built-in const that means carriage & return character.

    and vbTab is the const variable that means TAB character.


    how to use:

    MsgBox "Here is some text /newline /tab Here is the next line of text indented."

    MsgBox "Here is some text " & vbnewLine & vbTab & " Here is the next line of text indented."




    Thursday, March 29, 2007 4:55 AM
  • Thanks a lot. Is changing font and adding images as simple?
    Thursday, March 29, 2007 5:04 AM
  • it would be so difficult if you're not adroit to use windows' api function & vba programming.

    i have a reference web page for your info.

    plz refer http://www.catch22.net/tuts/msgbox.asp


    best regards


    Thursday, March 29, 2007 5:12 AM
  • Thanks, I will investigate.
    Thursday, March 29, 2007 5:40 AM
  • Thanks, but that level of coding is a bit beyond me at the moment. I was hoping for simple tools/functions.
    Thursday, March 29, 2007 1:46 PM