4. VbScript | Message Box: Spacing

So today we are going to be talking about the spacing of our Message Box text in VbScript. The code right below displays text in an unformatted manner.

MsgBox "Message1Message2Message3"

Output:
Capture

But if you wanted to start the text on a new line? Use vblf. Note that ampersand & are needed on both sides like so &vblf& to stay within the single MsgBox function ↓

MsgBox "Message1"&vblf&"Message2Message3"

Output:
Capture4

If you want to add a Tab (3 space-bar spaces):

MsgBox "Message1"&vblf&"Message2"&vbtab&"Message3"

Output:
Capture5

Another example; if you want double vertical spacing:

MsgBox "Message1"&vblf&vblf&"Message2Message3"

Output:
Capture6

*note that chr(10)=vblf and chr(9)=Tab


What's Your Opinion?