Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to "\n " in a VBScript MsgBox( )

Status
Not open for further replies.

stevepuri

Programmer
Mar 30, 2001
24
US
How do you do the JavaScript equivalent of "\n" for a newline in a VBScript message box.

JavaScript: alert("Line 1" + "\n" + "Line 2");

VBScript : MsgBox("Line 1" & "??" & "Line 2")

Thank you,
Steve.
 
Sometimes you have to use both Carriage Return and a Line Feed
.... & Chr$(13) & Chr$(10)
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
I sometimes use VB constants because they are familiar and easier to remember... like vbCrLf produces the Carriage Return and Line Feed. Things like vbInformation and vbQuestion work for the MsgBox icons instead of trying to remember what numbers produce what icons.

Vince
 
How do you put a newline when writing text to a text box. I tried vbcrlf but that didn't really work.
 
your textbox your writing to has to accept more than one line. I.E.
the property in a textbox created by Visual Basic is the multiline property only if this set to true can the textbox have more than one line.

What textbox are you trying to write to? Klae

You're only as good as your last answer!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top