OFF95: Using Startup Switches for Programs on OSB (134742)



The information in this article applies to:

  • Microsoft Office for Windows 95
  • Microsoft Office 97 Professional Edition for Windows
  • Microsoft Office 97 for Windows

This article was previously published under Q134742

SUMMARY

To customize a button on the Office Shortcut Bar (OSB) so that it performs a specific action when you click it, add a startup switch to the command line for the icon.

MORE INFORMATION

By default, the target or command line in the properties dialog box contains only the path to and the name of the application's executable file. To add a startup switch for the application on the Office Shortcut Bar, use the following method:
  1. To bring up the Properties dialog box, click the Office Shortcut Bar icon with the right mouse button, and click Properties.
  2. Click the Shortcut tab.
  3. In the Target box, type a space at the end of the command line, and then type the desired startup switch or switches for the application.
  4. Click OK to close the Properties dialog box.
  5. Click the application's icon to start the application with the switches in effect.
The following is a list of valid startup switches that you can be used for the Microsoft Office applications.

NOTE: Do not include the angle bracket (< >) characters in the actual text that you enter on the command line.

Also, note that the command line(s) for Microsoft Office 97 applications will generally include a different path. For example:
   C:\Program Files\Microsoft Office\Office\Excel.exe
				

instead of
   C:\Msoffice\Excel\Excel.exe
				

Microsoft Word

   To start Microsoft Word                           Startup switch
   -------------------------------------------------------------------
   Open an existing document                         <filename>
   Start with no document open                       /n
   Run a macro and prevent the AutoExec macro        /m <macroname>
      from running
   Prevent the AutoExec macro from running           /m
   Load a Word add-in                                /l <addinpath>
   Prevent add-ins and global templates              /a
     (including the Normal template) from loading
   With no Tip of the Day                            /w
   Create a file from a template                     /t <templatename>
				

For example, to open Microsoft Word without the Tip Of The Day and open a file called "My Test File.doc" the command line would be as follows:

C:\Msoffice\Winword\Winword.exe /w "c:\My Documents\My Test File.doc"

Microsoft Excel

   To start Microsoft Excel                          Startup switch
   --------------------------------------------------------------------
   Open a specific file                              <filename>
   Without a new, unsaved workbook                   /e
   Specify a working directory                       /p <path>
   Open a file read-only                             /r <filename>
				

For example, to open Microsoft Excel and specify the working directory to be "c:\My Directory" and open a file called "My File.xls" as read-only, the command line would be as follows:

C:\Msoffice\Excel\Excel.exe /p "c:\My Directory" /r "My File.xls"

PowerPoint

   To start Microsoft PowerPoint                     Startup switch
   --------------------------------------------------------------------

   Open a specific file                              <filename>
   Run a slide show automatically                    /s <filename>
   Print the presentation                            /p
   Create a new presentation                         /n
				

For example, to open Microsoft PowerPoint and automatically start a slide show called "c:\My Documents\Slide Show.ppt", the command line would be as follows:

C:\MSOFFICE\POWERPNT\POWERPNT.EXE /s "c:\My Documents\Slide Show.ppt"

Microsoft Access

   To start Microsoft Access                            Startup switch
   --------------------------------------------------------------------

   Open a specific database                          <database>
   Open the database exclusively                     /Excl
   Open the database as read only                    /Ro
   Start using a user name                           /User <user name>
   Start with a specific password                    /Pwd <password>
   Use a specific user profile                       /Profile <profile>
   Compact a database and close Microsoft Access     /Compact <database>
   Repair the database and close Microsoft Access    /Repair
   Convert database from an earlier version          /Convert <database>
   Run a specific macro                              /X <macro>
   Specify return value for the Command function     /Cmd
   Start without displaying the startup dialog       /Nostartup
   Start in run-time mode                            /Runtime
   Start using the specified workgroup information   /Wrkgrp <file>
      file (Microsoft Access 97 only)
				

REFERENCES

For more information about using command line switches with earlier versions of Microsoft Office, please see the following article in the Microsoft Knowledge Base:

121866 Using Startup Switches for Application in MOM

For more information about using command line switches with Microsoft Office version 7.0 applications, choose the Index tab in Help and type the keyword appropriate for the application you use to access Help:

If you use Microsoft Excel version 7.0 Help, type:

Starting Applications

If you use Microsoft Excel 97 Help, type:

starting, Microsoft Excel

If you use Microsoft Word version 7.0 Help, type:

Startup Switches

If you use Microsoft Word 97 Help, type:

startup options

If you use Microsoft PowerPoint Help, type:

Starting PowerPoint

If you use Microsoft Access version 7.0 Help, type:

Command-line Startup Options

If you use Microsoft Access 97 Help, type:

command-line options


Modification Type:MinorLast Reviewed:8/16/2005
Keywords:kbualink97 KB134742