APPENDIX

Command-Line Switches for Controlling Word Startup

IN THIS APPENDIX

  • Reviewing what command-line switches do
  • Learning the available command-line switches

You learned in Chapter 1, “Taking Your First Steps with Word,” that one option you have for starting Word 2013 is to create a shortcut for it on the Windows Desktop, as detailed in the section “Creating a desktop shortcut and shortcut key.” As shown in Figure 1.2, you can work with the entry in the Target text box of the Properties dialog box for the shortcut to control exactly how Word starts up or to perform certain tasks. This appendix details the command-line switches you can use when starting Word.

TIP

If you start Word using the Command or Run dialog box in either Windows 7 or 8, you also can use a command-line switch there.

Command-Line Switches

When you are using a command-line switch, note that they each require a space after the trailing quote that follows the file specification for the Word executable file, and before the backslash (), for example, “C:Program Files (x86)Microsoft OfficeOffice15WINWORD.EXE”[space]/a. There is no space, however, between the / and the character that follows it. Note also that when a file path specification or filename itself contains a space, the entire name must be enclosed in quotes.

In the Target text box of the shortcut's Properties dialog box, the entire startup file and path name appears enclosed in quotes. You should add the space and the startup switch outside the quotes (after the second quotation mark). For example, “C:Program Files (x86)Microsoft OfficeOffice15WINWORD.EXE” /safe starts Word in safe mode. This appendix shows the switches listed with a forward slash.

NOTE

The path C:Program Files (x86)Microsoft OfficeOffice15WINWORD.EXE is for the 32-bit version of Word 2013. For the 64-bit version, the path is C:Program FilesMicrosoft OfficeOffice15WINWORD.EXE. Vary the path according to your version when entering startup switches.

TIP

Sometimes getting the command-line specifications right involves a fair amount of trial and error. To save time and effort, create a full-function Windows shortcut for starting Word. Open the Properties dialog box and make your change(s) to the Target field. Click OK, and then test the shortcut.

/a

The /a switch prevents Word from automatically loading global templates (including your version of normal.dotm) and add-ins. It also prevents Word from loading some of the settings in Word's Data key in the registry. The /a switch often is used as a diagnostic tool for isolating problems with Word. Hence, if adding the /a switch “solves” whatever problem you're having, then the problem is located in a global template or an add-in.

NOTE

The /a switch in Word 2013 does not suppress changes to the QAT. It also doesn't prevent the display of files in the Recent Documents list when you click the File button.

Using the /a switch is not as drastic or complete as starting Word in safe mode, because add-ins and global templates can still be loaded manually when you use the /a switch. An interesting quirk about the /a switch is that sometimes running Word just once with it is enough to fix certain registry corruption problems. In contrast, starting Word in safe mode does not modify the registry.

/laddinpath

This switch starts Word and immediately loads a specific Word add-in—for example, /l“c:program filesstatstatpax.dll”.

/m

This switch prevents Word from running any AutoExec macros. It is sometimes used in trouble-shooting as well as to prevent damage to documents from unexpected AutoExec macros.

/mcommandname

This switch starts Word and immediately runs the indicated command or macro name. For example, /mfile1 starts Word and immediately runs the File1 command, which tells Word to open the first file listed in the Recently Used Files list. Or, if you want to start Word and display a new file, use the /mfilenew switch. If you want to start Word and see the legacy Word 2003 New dialog box for selecting from a handful of basic document templates rather than the Word Start screen, use /mfilenewdialog.

/n

This starts Word without opening a new blank document.

/pxslt

This switch starts Word and creates a new XML document based on the indicated XSLT (Extensible Stylesheet Language Transformation)—for example, /p“c:XMLformatted.xsl”.

/r

The /r switch forces Word to rewrite the registry entries. This is often used to fix problems with corrupted registry entries. Only the registry entries are changed, and Word opens and closes quickly.

/safe

This switch starts Word in safe mode. This is the same as starting Word while holding down the Ctrl key and then clicking Yes. The full specifications of what safe mode does in Word 2013 are not available as of this writing. They will be similar to those for Word 2010, however, which are available at http://support.microsoft.com/kb/210565.

/tfilename

This switch starts Word and opens the single document file specified—for example, /tBrochure.docx or /t“C: UsersLisaDocumentsBrochure.docx”.

/ttemplatename

This switch starts Word and creates a new document based on the indicated template—for example, /tBrochure.dot or /t“C:Program Files (x86)Microsoft OfficeTemplates1033Brochure.dot”.

/u

This switch merely prevents Word from loading. If you're a system administrator, you could temporarily disable users’ ability to run Word using this switch.

/w

This switch starts a new instance of Word with a new blank Document window. The new document will not appear as an option in the View images Window images Switch Windows list of other open instances of Word.

pathfilename

Specifying a path and file name causes Word to open that file. This method works best when you want to open multiple files when you open Word. If the path is missing, the file must be located in Word's default document folder. For example, to create a shortcut for Word to open a document named C:UsersLisaDocumentsResources.docx, I might use the following target specification: “C:Program Files (x86)Microsoft OfficeOffice15WINWORD.EXE” C:UsersLisaDocumentsResource.docx C:UsersLisaDocumentsEditors.docx.

Note that both the program specification and the full path and name of the startup command is inside quotes, but the file paths and names are not. As noted earlier, when the path and file name don't include any spaces, you can leave the quotes out. In practice, it's a good idea to be in the habit of using them so you don't forget them when needed, so I often include them even when not strictly called for. The switch will still work with quotes around the file name and path.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset