Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    wrod wrap in a msgbox (XL2000 sr1 on W2K sp2)

    Is it possible to include new line characters in the text within a message box?
    so that instead of:
    msgbox "this text is all displayed in one line in a very wide message box, OK to carry on working , Cancel because it's <img src=/S/coffeetime.gif border=0 alt=coffeetime width=32 height=48>", vbOKCancel

    I'd could have this sort of thing:
    msgbox "this is a short line, {magic code} OK to carry on working {magic code} Cancel because it's <img src=/S/coffeetime.gif border=0 alt=coffeetime width=32 height=48>", vbOKCancel

    and get three lines of text in the displayed box.:
    This is a short line
    OK to...
    Cancel to...

    stuck

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: wrod wrap in a msgbox (XL2000 sr1 on W2K sp2)

    msgbox "this is a short line," & vbcrlf &"OK to carry on working" & vbcrlf &"Cancel because it's ", vbOKCancel

    Or even (for readability)
    msgbox "this is a short line," & vbcrlf & _
    "OK to carry on working" & vbcrlf & _
    "Cancel because it's ", vbOKCancel


    Steve

  3. #3
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: wrod wrap in a msgbox (XL2000 sr1 on W2K sp2)

    <img src=/S/thewave.gif border=0 alt=thewave width=225 height=33>

    Briliant, presumably this handy info is in the XL help file somewhere and it's just that I can't find it there?

    stuck

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: wrod wrap in a msgbox (XL2000 sr1 on W2K sp2)

    vbCRLF is a VB constant composed of a carriage return (ASCII 13) and a Linefeed char (ASCII 10).

    FYI, there is also a vbLF and a vbCR if you need those.

    Steve

Posting Permissions

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