Excel for Microsoft 365 Word for Microsoft 365 Outlook for Microsoft 365 PowerPoint for Microsoft 365 Access for Microsoft 365 Excel 2021 Word 2021 Outlook 2021 PowerPoint 2021 Access 2021 Excel 2019 Word 2019 Outlook 2019 PowerPoint 2019 Access 2019 Excel 2016 Word 2016 Outlook 2016 PowerPoint 2016 Access 2016 Outlook 2013 More. Less
When you launch a Microsoft Office product, the startup process runs in a standard way. Microsoft Word, for example, displays the Word splash screen and loads the Normal template. But suppose you want Word to start without its splash screen and then load a template other than the Normal template. Or, you want to customize the process even more by loading an add-in or running a macro upon startup. You can add options like this by using subcommands called command-line switches to an Office app's startup command.
If you want to use the customization just one time, you can type the command and switch in the Run dialog box (Start menu) in Microsoft Windows. If you want to use a particular switch many times or every time that you start the app, you can create a desktop shortcut that starts the program by using the same switch and parameters. This article describes how to do both. It also includes a table that lists all of the switches and parameters that are available in the desktop Office apps.
About commands, switches, and parametersUsing a command-line switch doesn't mean you have to type the whole startup command at the command prompt. You can start the Office app as usual, by clicking the program icon on the desktop, or by clicking the program name on the Start menu. All startup methods essentially do the same thing: they run the app's .exe file, even if you don't actually type the command or even see it.
A command-line switch is a modifier that is added to the .exe file. A startup file with a switch looks like this.
outlook.exe /nopreview
In this example, a command-line switch has been added to the .exe file for Microsoft Outlook. The switch consists of a forward slash and a word or abbreviation that indicates the switch's action. This switch tells Outlook to launch without showing the Reading Pane.
A switch is sometimes followed by one or more specific instructions called parameters, which give the program further information about how to run the .exe command. For example, the following command tells Outlook to load a specific profile name upon startup.
outlook exe /profile profilename
Switch names cannot be abbreviated and are not case-sensitive. However, their parameters are sometimes case-sensitive.
Startup command names and locationsHere are the names of the startup commands for the Office products Word, Excel, PowerPoint, PowerPoint viewer, Outlook, and Access.
When you use one of the Office startup commands, you must supply the full path to the product's .exe file. Verify the location of this file on your computer. This table shows the locations of the .exe files if you accepted the default folder locations during installation.
In Office 2016
& Office 2019
Windows 32-bit: C:\Program Files (x86)\Microsoft Office\Office16\
Windows 64-bit: C:\Program Files\Microsoft Office\Office16\
Windows 32-bit: C:\Program Files (x86)\Microsoft Office\root\Office16\
Windows 64-bit: C:\Program Files\Microsoft Office\root\Office16\
Use a switch once by adding it to the Run command"c:\program files\microsoft office\office15\outlook.exe" /nopreview
The next time you start the app, it opens as usual. To make your customized startup available for repeated uses, see the next section.
Note the following about using command-line switches:
"c:\program files\microsoft office\office15\excel.exe" /r "c:\My Folder\book1.xlsx"
Whenever you want to use the shortcut to start the app, double-click it.
To add the desktop shortcut to the Windows Start menu, right-click the shortcut, and then click Pin to Start menu on the shortcut menu.
Each Office product has a different set of command-line switches.
Switch and parameter
Description
Starts Word in Safe Mode.
Starts Word without displaying the Word splash screen.
Starts Word with a new document based on a template other than the Normal template.
Example To start Word with a document based on a template called Myfax.dotx, stored on the C drive, type the following at the command prompt:
Note: Do not include a space between the switch and the name of the template file.
Security Note: Because templates can store macro viruses, be careful about opening them or creating files based on new templates. Take the following precautions: run up-to-date antivirus software on your computer, set your macro security level to high, clear the Trust all installed add-ins and templates check box, use digital signatures, and maintain a list of trusted sources.
Starts Word and opens an existing file.
Example To start Word and open the template file Myfax.dotx, stored on the C drive, type the following at the command prompt:
Example To start Word and open multiple files, such as MyFile.docx and MyFile2.docx, each stored on the C drive, type the following at the command prompt:
/t c:\MyFile.docx c:\MyFile2.docx
Starts Word with a new document based on an existing file.
Example To start Word and create a new document based on file MyFile.docx, stored on the desktop, type the following at the command prompt:
/f "c:\Documents and Settings\All Users\Desktop\MyFile.docx"
Starts Word and opens a read-only copy of a document that is stored on a Microsoft Windows SharePoint Services site. The site must be on a computer that is running Word 2007 or later or Windows SharePoint Services 2.0 or later.
Example To start Word and open a copy of file MyFile.docx, stored in a document library at the URL http://MySite/Documents, type the following at the command prompt:
Note: If the document is checked out to you, the /h switch has no effect. Word opens the file so that you can edit it.
Starts Word and opens an existing XML document based on the specified Extensible Stylesheet Language Transformation (XSLT).
Example To start Word and apply the XSLT MyTransform, stored on the C drive, to the XML file Data.xml, also stored on the C drive, type the following at the command prompt:
Starts Word and prevents add-ins and global templates (including the Normal template) from being loaded automatically. The /a switch also locks the setting files.
Starts Word and then loads a specific Word add-in.
Example To start Word and then load the add-in Sales.dll, stored on the C drive, type the following at the command prompt:
Note: Do not include a space between the switch and the add-in name.
Security Note: Use caution when running executable files or code in macros or applications. Executable files or code can be used to carry out actions that might compromise the security of your computer and data.
Starts Word without running any AutoExec macros.
Starts Word and then runs a specific macro. The /m switch also prevents Word from running any AutoExec macros.
Example To start Word and then run the macro Salelead, type the following at the command prompt:
Note: Do not include a space between the switch and the macro name.
Because macros can contain viruses, be careful about running them. Take the following precautions: run up-to-date antivirus software on your computer; set your macro security level to high; clear the Trust all installed add-ins and templates check box; use digital signatures; maintain a list of trusted publishers.
Starts a new instance of Word with no document open. Documents opened in each instance of Word will not appear as choices in the Switch Windows list of other instances.
Starts a new instance of Word with a blank document. Documents opened in each instance of Word will not appear as choices in the Switch Windows list of the other instances.
Re-registers Word in the Windows registry. This switch starts Word, runs Office Setup, updates the Windows registry, and then closes.
Starts Word from the operating system shell so that Word responds to only one Dynamic Data Exchange (DDE) request (for example, to print a document programmatically).
Visibly behaves exactly like the /t switch. However, you can use the /z switch with Word to generate both a Startup and a New event, whereas the /t switch generates only a Startup event.
Switch and parameter
Description
workbook path | file name
This parameter does not require a switch.
Starts Excel and opens the specified file.
excel.exe "c:\My Folder\book1.xlsx"
/r workbook path | file name
Opens a specific workbook as read-only.
excel.exe /r "c:\My Folder\book1.xlsx"
excel.exe /r http://MySite/Book1.xlsx
/t workbook path | file name
Starts Excel and opens the specified file as a template.
excel.exe /t "c:\My Folder\book_name.xlsx" .
excel.exe /t http://MySite/book_name.xlsx
/n workbook path | file name
Like /t, starts Excel and opens the specified file as a template.
excel.exe /n "c:\My Folder\book_name.xlsx" .
excel.exe /n http://MySite/book_name.xlsx
/e or /embed
Prevents the Excel startup screen from appearing and a new blank workbook from opening.
/p workbook path
Specifies a folder as the active working folder (for example, the folder that is pointed to in the Save As dialog box).
excel.exe /p "c:\My Folder"
/s or /safemode
Forces Excel to bypass all files that are stored in startup directories, such as the default XLStart folder located in the directory where Excel or Microsoft Office is installed.
Creates a new workbook that contains a single XLM macro sheet.
/a progID
Starts Excel and loads the Automation add-in that is specified by the progID of the add-in.
excel.exe /a MyProgId.MyProgID2.1
Starts a new instance (a separate process) of Excel.
excel.exe /x "c:\My Folder\book1.xlsx"
excel.exe /x http://MySite/Book1.xlsx
Here are the command-line switches that are available for PowerPoint.
Switch or parameter
Starts PowerPoint with a new blank presentation.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /B
Starts PowerPoint with the specified file open and also starts Microsoft Windows NetMeeting conferencing.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /C NetMeetingPresentation.pptx
Note: If you use this switch without specifying a file, PowerPoint starts with no presentation open and NetMeeting conferencing is not started.
Starts PowerPoint without displaying the Office PowerPoint 2007 program window. Developers use this switch when testing add-ins.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /EMBEDDING
Runs a macro in a specified presentation.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /M myfile.pptm "MyMacro"
"MyMacro" is a macro in the file myfile.pptm.
Starts PowerPoint and creates a new presentation.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /N "Path\templatename.potx"
This example specifies the name of the template that the new presentation is based on: templatename.potx.
If a template name is not supplied, PowerPoint starts a new presentation based on the blank template (in effect, the same as using the /N switch without a template name).
Starts PowerPoint and specifies a list of files to open.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /O File name1.pptx, File name2.pptx
Prints the presentation to the default printer by using default settings.
When you use the /P switch, PowerPoint displays the Print dialog box before printing. After you choose options and click OK, the dialog box closes, and PowerPoint prints the file and then closes. If you don't want to see PowerPoint at all, use the /PT (Print To) switch instead.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /P "MyFile.pptx"
Prints the presentation to the specified printer by using the default settings.
If you don't want to see PowerPoint at all, use the /PT (Print To) switch.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /PT "PrinterName" "" "" "MyFile.pptx"
PrinterName is the name of the printer that appears in the Name box under Printer in the Print dialog box. The empty quotation marks are necessary; the quotation marks around PrinterName and the path to the PPTX file are needed only if there are spaces in either of the names, but it is always a good idea to use them.
Prints the specified file, but show the Print dialog box.
When you use the /P switch, PowerPoint displays the Print dialog box before printing. After you choose options and click OK, the dialog box closes, and PowerPoint prints the file and then closes. If you don't want to see PowerPoint at all, use the /PT (Print To) switch instead.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /PWO "MyFile.pptx"
Restores PowerPoint to the way it was before the program closed abnormally. When PowerPoint restarts, it will attempt to recover and restore some aspects of the state of the program and presentations before it closed.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /RESTORE
Opens the specified presentation file as a slide show.
Example: "c:\program files\microsoft office\office12\POWERPNT.exe" /S "Presentation1.pptx"
Here are the command-line switches that are available for PowerPoint Viewer.
Switch or parameter
Shows the Open dialog box when the presentation ends.
Example: "c:\program files\microsoft office\office12\PPTVIEW.exe" /D
Reads a playlist of PowerPoint presentations contained within a text file.
Example: "c:\program files\microsoft office\office12\PPTVIEW.exe" /L "Your_Play_List.txt "
Note: The playlist file is a list of presentation file names (preceded by the path as needed). It is not possible to add additional command-line switches to the individual presentations within the playlist.
Opens the presentation at a specified slide number, instead of slide 1.
Example: "c:\program files\microsoft office\office12\PPTVIEW.exe" /N5 "Presentation.pptx"
This example opens Presentation.pptx at slide 5.
Starts the viewer without showing the splash screen.
Example: "c:\program files\microsoft office\office12\PPTVIEW.exe" /S
Sends the presentation to a printer, and print the file.
Example: "c:\program files\microsoft office\office12\PPTVIEW.exe" /P "Presentation.pptx"
This example prints the Presentation.pptx file.
Description
Creates an item with the specified file as an attachment.
If no item type is specified, IPM.Note is assumed. Cannot be used with message classes that are not based on Outlook.
Opens the VBA program specified in otmfilename, instead of %appdata%\microsoft\outlook\vbaproject.otm.
Creates a new item of the specified message class (Outlook forms or any other valid MAPI form).
Prompts for the default manager of e-mail, news, and contacts.
Removes all names and e-mail addresses from the Auto-Complete list. (Outlook 2013, 2016 only)
Deletes any custom category names that you have created. Restores categories to the default names.
Starts Outlook and deletes client-based rules.
Deletes the Conversations Actions Table (CAT). CAT entries for a conversation thread usually expire 30 days after no activity. The command-line switch clears all conversation tagging, ignore, and moving rules immediately stopping any additional actions. (Outlook 2013, 2016 only)
Deletes the logging records saved when a manager or a delegate declines a meeting.
Resets all Search Folders in the Microsoft Exchange mailbox for only the first profile opened.
Removes all manually added From entries from the profile.
Removes all MailTips from the cache. (Outlook 2013, 2016 only)
Clears and regenerates reminders.
All previous roamed preferences are deleted and copied again from the local settings on the computer where this switch is used. This includes the roaming settings for reminders, free/busy grid, working hours, calendar publishing, and RSS rules.
Starts Outlook and deletes client-based and server-based rules.
Important If you have multiple or additional mailboxes in your Outlook profile, running the /cleanrules command line switch deletes the rules from all connected mailboxes. Therefore, it is recommended that you only run this command when your Outlook profile only contains the one, target mailbox.
Starts Outlook and deletes server-based rules.
Removes all RSS, Internet Calendar, and SharePoint subscriptions from Account Settings, but leaves all the previously downloaded content on your computer. This is useful if you cannot delete one of these subscriptions within Outlook 2013.
Overrides the programmatic lockout that determines which of your computers (when you run Outlook at the same time) processes meeting items. The lockout process helps prevent duplicate reminder messages. This switch clears the lockout on the computer it is used. This enables Outlook to process meeting items.
Deletes the subscription messages and properties for subscription features.
Removes city locations added to the Weather Bar.
Restores default views. All custom views you created are lost.
Used without command-line parameters for standard OLE co-create.
Opens the specified message file (.msg) or Microsoft Office saved search (.oss).
Opens the Advanced Find dialog box.
Opens the specified .hol file.
Opens the specified .ics file.
Imports the contents of an .nk2 file which contains the nickname list used by both the automatic name checking and Auto-Complete features.
Starts Outlook and opens/imports the defined MAPI profile (*.prf). If Outlook is already open, queues the profile to be imported on the next clean start.
Opens a Help window with the Help topic specified in assetid displayed.
Provides a way for the user to add an e-mail name to the item. Only works together with the /c command-line parameter.
Both native and managed Component Object Model (COM) add-ins are turned off.
Starts Outlook with the Reading Pane off.
Prints the specified message (.msg).
/profile profilename
Loads the specified profile. If your profile name contains a space, enclose the profile name in quotation marks (" ").
Opens the Choose Profile dialog box regardless of the Options setting on the Tools menu.
Same as /importprf except a prompt appears and the user can cancel the import.
Starts Outlook by using an existing Outlook window, if one exists. Used in combination with /explorer or /folder.
Starts Outlook and starts the following commands on the default mailbox:
Note: This is the same command as Upgrade to Color Categories in each Outlook mailbox properties dialog box.
Restores missing folders at the default delivery location.
Resets default folder names (such as Inbox or Sent Items) to default names in the current Office user interface language.
For example, if you first connect to your mailbox in Outlook by using a Russian user interface, the Russian default folder names cannot be renamed. To change the default folder names to another language, such as Japanese or English, you can use this switch to reset the default folder names after you change the user interface language or install a different language version of Outlook.
Empties the form regions cache and reloads the form region definitions from the Windows registry.
Clears and regenerates the Folder Pane for the current profile.
Restores the default Quick Steps. All user-created Quick Steps are deleted.
Resets all Instant Search criteria so the default set of criteria is shown in each module.
Removes all shared folders from the Folder Pane.
Clears and regenerates the To-Do Bar task list for the current profile.
Attempts to open the same profile and folders that were open prior to an abnormal Outlook shutdown. (Outlook 2013, 2016 only)
Opens Outlook and displays the remote procedure call (RPC) connection status dialog box.
Starts Outlook without the Reading Pane or toolbar customizations. Both native and managed Component Object Model (COM) add-ins are turned off.
Starts Outlook with the Reading Pane off.
Both native and managed Component Object Model (COM) add-ins are turned off.
Starts Outlook and opens the specified folder in a new window. For example, to open Outlook and display the default calendar, use: "c:\program files\microsoft office\office15\outlook.exe" /select outlook:calendar.
Specifies a sharing URL to connect to Outlook. For example, use stssync://URL to connect a SharePoint list to Outlook.
Starts Outlook, forces a detection of new meeting requests in the Inbox, and then adds them to the calendar.
Opens the specified .oft file.
Opens the specified .vcf file.
Opens the specified .vcs file.
Description
Opens the specified database or Microsoft Access project. You can include a path, if necessary. If the path contains spaces, enclose it in quotation marks.
Opens the specified Access database for exclusive access. To open the database for shared use in a multiuser environment, omit this switch. Applies to Access databases only.
Opens the specified Access database or Access project for read-only use.
Specifies that Access will start with runtime version options.
Starts Access by using the options in the specified user profile instead of the standard Windows Registry settings created when you installed Access. This replaces the /ini switch used in versions of Access prior to Access 95 to specify an initialization file.
target database or target Access project
Compacts and repairs the Access database, or compacts the Access project that was specified before the /compact switch, and then closes Access. If you omit a target file name following the /compact switch, the file is compacted to the original name and folder. To compact to a different name, specify a target file. If you include a path that contains spaces, enclose the path in quotation marks.
If you specify a file name in the target database or target Access project parameter but you don't include a path, the target file is created in the default database folder that is specified in Access. You can change this setting in the Access Options dialog box.
In an Access project, this option compacts the Access project (.adp) file but not the Microsoft SQL Server database.
Opens the Access database that was specified before the /x switch, and then runs the specified macro. Another way to run a macro when you open a database is to create a macro named AutoExec.
Macros can contain viruses, so you must be careful about running them. Take the following precautions: run up-to-date antivirus software on your computer; use the Trust Center to disable all macros except those that are digitally signed; maintain a list of trusted sources of macros.
Specifies that what follows on the command line is the value that will be returned by the Command function. This option must be the last switch on the command line. You can use a semicolon (;) as an alternative to /cmd.
Use this switch to specify a command-line argument that can be used in Visual Basic for Applications (VBA) code.