Command-line switches for Microsoft Office products


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 parameters Using 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 locations Here are the names of the startup commands for the Office products Word, Excel, PowerPoint, PowerPoint viewer, Outlook, and Access. Word winword.exe Excel excel.exe PowerPoint powerpnt.exe PowerPoint Viewer pptview.exe Outlook outlook.exe Access msaccess.exe 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 2007 Windows 32-bit: C:Program Files (x86)Microsoft OfficeOffice12 Windows 64-bit: C:Program FilesMicrosoft OfficeOffice12 In Office 2010 Windows 32-bit: C:Program Files (x86)Microsoft OfficeOffice14 Windows 64-bit: C:Program FilesMicrosoft OfficeOffice14 In Office 2013 Windows 32-bit: C:Program Files (x86)Microsoft OfficeOffice15 Windows 64-bit: C:Program FilesMicrosoft OfficeOffice15 In Office 2016 Windows 32-bit: C:Program Files (x86)Microsoft OfficeOffice16 Windows 64-bit: C:Program FilesMicrosoft OfficeOffice16 Use a switch once by adding it to the Run command In Windows 10, click the Search or Cortana icon in the taskbar, type Run, and then click Command Prompt in the results. In Windows 8, press the Windows key, type Run, and then press Enter. In Windows 7, click Start, point to All Programs, click Accessories, and then click Run. In the Run dialog box, type a quotation mark, enter the full path for the app’s .exe file, and then type another quotation mark. Alternatively, click Browse to locate and select the file. In this case, the quotation marks are supplied automatically. After the closing quotation mark, type a space, and then type the switch. For example, you might type: “c:program filesmicrosoft officeoffice15outlook.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: You can use only one switch at a time. Starting an Office app with multiple switches is not supported. If the parameter is a path to a location on your computer, or a file name with spaces in it, enclose it in double quotation marks—for example, /t “Monthly…

Source

Leave a Reply

Your email address will not be published. Required fields are marked *