Command-line switches for Publisher 2007

To modify how Microsoft Office Publisher 2007 starts, you can add switches and parameters to the startup command. For example, you can start Office Publisher 2007 with a blank publication, an existing publication, or a specific template.

If you want to use a switch and any associated parameters only once, you can add switches to the Microsoft Windows Run command (Start menu). If you plan to use a customized startup method frequently, you can create a shortcut on the Windows desktop.

A table lists the most common switches and parameters that are available in Office Publisher 2007.

In this article

Introducing commands, switches, and parameters

Use a switch once by adding it to the Run command

Make a switch available for reuse by creating a shortcut

Available switches and parameters

Introducing commands, switches, and parameters

Each time you start Office Publisher 2007, you are actually running the MSPUB.exe command, although you do not usually type the command or even see it. You can change certain aspects of how Office Publisher 2007 starts by adding subcommands called switches to the MSPUB.exe command.

A switch prompts the application to do something like open a file, or it makes the application operate in a specific mode. A switch appears after the main command, following a space and a forward slash (/). Sometimes the switch is followed by another space and then one or more specific instructions called parameters. Parameters give the program additional information about how to execute the MSPUB.exe command.

For example, the following command instructs Office Publisher 2007 to start and immediately open the template named Contoso Business Card.pub.

MSPUB.exe /o "Contoso Business Card.pub"

Top of Page

Use a switch once by adding it to the Run command

First, you must verify the location of the MSPUB.exe file on your computer. If you accepted the default folder locations when you installed Office Publisher 2007 the MSPUB.exe file is probably located at:

C:\Program Files\Microsoft Office\Office12\MSPUB.exe

If you do not find the MSPUB.exe file at that location, search for the file, make a note of the full path, and verify that Office Publisher 2007 is correctly installed on your computer.

  1. Do one of the following:

    • Windows Vista    Click the Start button Button image, point to All Programs, click Accessories, and then click Run.

    • Microsoft Windows XP or Microsoft Windows Server 2003    Click the Start button, and then click Run.

  2. In the Run dialog box, type the full path for the MSPUB.exe file (including the file name), or click Browse to locate it.

  3. At the end of the path, type a space, and then type the switch and any parameters. For example, you can type:"c:\program files\microsoft office\office12\mspub.exe" /o "Contoso Business Card.pub"

The next time that you start Office Publisher 2007, the program returns to its previous defaults. To make your customized startup available for repeated uses, see the next section.

Notes   

  • Switches and parameters are not case-sensitive. For example, /A is the same as /a.

  • Remember to include one blank space before the switch and one before each parameter.

  • If the path or the file name has spaces in it, enclose the complete name in quotation marks — for example, "Contoso Business Card.pub".

Top of Page

Make a switch available for reuse by creating a shortcut

First, you must verify the location of the MSPUB.exe file on your computer. If you accepted the default folder locations when you installed Office Publisher 2007, the MSPUB.exe file is probably located at:

C:\Program Files\Microsoft Office\Office12\MSPUB.exe

If you do not find the MSPUB.exe file at that location, search for the file, make a note of the full path, and verify that Office Publisher 2007 is correctly installed on your computer.

  1. Right-click the Windows desktop, point to New, and then click Shortcut on the shortcut menu.

  2. In the Type the location of the item box, type the full path for the MSPUB.exe file (including the file name), or click Browse to locate it.

  3. At the end of the path, type a space, and then type the switch and any parameters. For example, you can type: "c:\program files\microsoft office\office12\mspub.exe" /o c:\MyPublication.pub

  4. Click Next.

  5. In the Type a name for this shortcut box, type a name for the shortcut, and then click Finish.

    The shortcut appears on the desktop.

  6. Whenever you want to start Office Publisher 2007 in this particular customized way, double-click the shortcut.

  7. To add the desktop shortcut to the Start menu in Windows, right-click the shortcut, and then click Pin to Start menu on the shortcut menu.

You can create a variety of shortcuts, each of which applies different switches and parameters to the program at startup.

Notes   

  • Switches and parameters are not case-sensitive. For example, /A is the same as /a.

  • Remember to include one blank space before the switch and one before each parameter.

  • If the path or the file name has spaces in it, enclose the complete name in quotation marks — for example, "Contoso Business Card.pub".

Top of Page

Available switches and parameters

Switches and parameters

Description

/safe

Starts Publisher in safe-mode.

Example    To start Publisher in Safe Mode after it has failed to start normally, type the following at the command prompt:

/safe

/b

Starts Publisher with a blank publication open.

Example    To start Publisher with a blank publication open, type the following at the command prompt:

/b

/t filename

Starts Publisher and opens an existing file as a template.

Example    To start Publisher using a file as a template, type the following at the command prompt:

/t filename

Note   The filename variable can identify the file by the path to the file, by a URL, or by the file path to the Windows Explorer shortcut (*.LNK) to the file or URL. If the file name has spaces in it, enclose the complete name in quotation marks. For example, type /t "Contoso Business Card.pub"

/o filename

Starts Publisher and opens an existing file.

Example    To open a file, type the following at the command prompt:

/o filename

Note   The filename variable can identify the file by the path to the file, by a URL, or by the file path to the Windows Explorer shortcut (*.LNK) to the file or URL. If the file name has spaces in it, enclose the complete name in quotation marks. For example, /t "Contoso Business Card.pub"

/w

Starts Publisher with the catalog of publication types open, even if the Show Publication Types when starting Publisher option is not selected.

Example    To start Publisher with the catalog of publication types open, type the following at the command prompt:

/w

/p filename

Prints the file that you name, and then closes Publisher.

Example    To print a file and then close Office Publisher 2007, type the following at the command prompt:

/p filename

Note    The filename variable can identify the file by the path to the file, by a URL, or by the file path to the Windows Explorer shortcut (*.LNK) to the file or URL. If the file name has spaces in it, enclose the complete name in quotation marks. For example, /t "Contoso Business Card.pub"


Top of Page

Applies To: Publisher 2007



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language