Skip to main content

Adding a line break to your dialogs

Here is a trick.  If you ever want to diplay some text in a dialog or message box and want to add breaking lines so that the text is not one long paragraph you can use the following:

Dim CrLf as string

Dim msg as string

CrLf = Chr(10) & Chr(13)

msg = "Line 1" & CrLf

msg = msg & "Line 2" & CrLf

msgbox msg

Now line 1 and line 2 will appear on different lines.

The website encountered an unexpected error. Try again later.