Access Command function

Syntax
Command

Returns the argument portion of the command line used to launch Microsoft Visual Basic or an executable program developed with Visual Basic. The Visual Basic Command function is not available in Microsoft Office applications.

When Visual Basic is launched from the command line, any portion of the command line that follows /cmd is passed to the program as the command-line argument. In the following command line example, cmdlineargs represents the argument information returned by the Command function.

Code Examples
This example uses the Command function to get the command line arguments in a function that returns them in a Variant containing an array. Not available in Microsoft Office.