Document conventions (Visual Basic for Applications)

Last modified: December 06, 2011

Applies to: Office 2013 | VBA

Visual Basic documentation uses the following typographic conventions.



Sub, If, ChDir, Print, True, Debug

Words in bold with initial letter capitalized indicate language-specific keywords.


Words you are instructed to type appear in bold.

object, varname, arglist

Italic, lowercase letters indicate placeholders for information you supply.

pathname , filenumber

Bold, italic, and lowercase letters indicate placeholders for arguments where you can use either positional or named-argument syntax.


In syntax, items inside brackets are optional.

{While | Until}

In syntax, braces and a vertical bar indicate a mandatory choice between two or more items. You must choose one of the items unless all of the items are also enclosed in brackets. For example: [{This | OrThat}]


Words in capital letters indicate key names and key sequences.


A plus sign (+) between key names indicates a combination of keys. For example, ALT+F1 means hold down the ALT key while pressing the F1 key.

Code Conventions

The following code conventions are used:

Sample Code


This font is used for code, variables, and error message text.

An apostrophe (') introduces code comments.

A space and an underscore ( _) continue a line of code.

© 2014 Microsoft