WordBasic Shell Command Defined

Last reviewed: July 30, 1997
Article ID: Q50816
The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c

SUMMARY

The WordBasic Shell command starts another program under Microsoft Windows.

Syntax

Shell "App$", Window_Style

App$ uses the same format as the File Run command in the Windows MS-DOS Executive, including any switches or arguments that the program accepts. If App$ is the name of a file with an extension specific to an installed application (.DOC for a Word document, for example), the statement starts the application and loads that file.

Window_Style specifies how the window containing the program should appear, as follows:

   Mode     Window Type
   ----     -----------

   0        Minimized window; default
   1        Normal window
   2        Minimized window (for Microsoft Excel
            compatibility)
   3        Maximized window
   4        Deactivated window

Example

Shell "C:\EXCEL\EXCEL.EXE",2    Starts Microsoft Excel and minimizes
            the window

MORE INFORMATION

If the application that is being shelled is not listed on the PATH statement in the AUTOEXEC.BAT file, and the full directory and path are not stated in App$, then Microsoft Word generates the error message:

   Cannot find or run application.

For more information on WordBasic functions and statements, please refer to the "Microsoft Word for Windows Technical Reference."

Kbcategory: kbusage kbmacro KBSubcategory:


Additional query words: 2.0 winword winword2 word6
Version : 1.x 2.x 6.0 6.0a 6.0c
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.